d3d_set_perspective == inversed y?
#1
Posted 11 August 2012 - 11:48 AM
I was creating a game and I decided to add a perspective to the game, but when I enabled 3D-mode, the y-axis was flipped, that so the room appear upside-down.
How do I revert it back to the original?
(I have tried tampering with some d3d_transform_add_rotation-functions, but when I did that, the y-axis was flipped back to the original, but then the controllers (left/right) and the direction/speed of view[0] was inverted).
What do I do? Does anybody of you know? :-)
#2
Posted 11 August 2012 - 12:15 PM
#3
Posted 11 August 2012 - 12:59 PM
#4
Posted 11 August 2012 - 02:35 PM
#5
Posted 11 August 2012 - 05:14 PM
I also tried to change "room_width" and "room_height" in the "w" and "h"-section of the function to "view_wview[0]" and "view_yview[0]", but then Game Maker ran upon an unexpected error wile running the game.
So, I still don't know what I do wrong. Do you have more ideas?
#6
Posted 11 August 2012 - 05:51 PM
d3d_set_projection_ext(0, 0, 0, room_width, room_height, 0, 0, 0, 0, 180, 0, 0, 5);
#7
Posted 12 August 2012 - 10:56 AM
#8
Posted 12 August 2012 - 11:06 AM
EDIT: Random thought: d3d_set_projection_perspective() still exists. Try: d3d_set_projection_perspective(0, 0, room_width, room_height, 180);.
Edited by G-Games, 12 August 2012 - 11:09 AM.
#9
Posted 12 August 2012 - 03:03 PM
var w,h; w = view_wview; h = view_hview; d3d_set_projection(w/2+view_xview,h/2+view_yview,w, w/2+view_xview,h/2+view_yview,0,0,-1,0);
A word of warning though, the sprites will appear offset from the 0 level, if they have non-zero depth value (if this causes problems, you either need to use ortho projection for the 2D stuff and draw the 3D stuff separately with this projection, or draw all the sprites as 3D walls or undo the depth translation by means of d3d_transform_set_translation).
#10
Posted 12 August 2012 - 09:29 PM
Moreover, the z-axis has been reversed, and I don't know how to solve that one. (setting "zfrom" from "w" to "-w" did help, but then the controllers (left-right) was inversed, again! ) --- (or should I just change everything related to drawing in the z-axis to a negative value instead of a positive?)
#11
Posted 13 August 2012 - 05:28 PM
var w,h; w = view_wview; h = view_hview; d3d_set_projection(w/2+view_xview,h/2+view_yview,w, w/2+view_xview,h/2+view_yview,0,0,-1,1);
0 transform to 1 at the zup.
Then about the tiles, just 180 degree turn your background and it should look fine. No need to use difficult coding for that.
#12
Posted 17 August 2012 - 08:18 PM
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users











