the_dude_abides
Member
I am trying to use 3d in Studio 1, but am having difficulty getting the projection (camera) right.
All that is required is a top-down camera, that when it moves across horizontally across a room see's what you'd expect from a view. However I am finding it hard to do that.
Draw event: (and yes - I do know that this code block turns off 3d at the end. I have some 2d stuff drawing afterwards that I haven't included)
According to the manual
"The above code sets up a basic 3D perspective projection."
But when I use it the image is upside down. How can I set this up correctly?
EDIT:
Is it just a case of converting every 3d objects 'y' position into 'room_height - y'?
Or is there something simpler which will make it right?
All that is required is a top-down camera, that when it moves across horizontally across a room see's what you'd expect from a view. However I am finding it hard to do that.
Draw event: (and yes - I do know that this code block turns off 3d at the end. I have some 2d stuff drawing afterwards that I haven't included)
GML:
d3d_start();
draw_set_color(c_white);
d3d_set_projection_perspective(x, y, room_width, room_height, 0);
d3d_draw_block(20, 100, 20, 40, 140, 60, -1, 1, 1);
d3d_end()
Code:
d3d_set_projection_perspective(x, y, room_width, room_height, 0);
But when I use it the image is upside down. How can I set this up correctly?
EDIT:
Is it just a case of converting every 3d objects 'y' position into 'room_height - y'?
Or is there something simpler which will make it right?
Last edited: