lolslayer
Member
I just found out that 3D depth doesn't work anymore for me in game maker, and I don't know why. Some projects do actually still work and others don't.
If it's a game maker or a setting problem, please help me if you know anything about that, it could be because I changed the windows 8.1 preferences and those aren't valid as of yet, but they weren't before.
In the case that my code is wrong, here is my code:
Create event:
Step event:
Draw event:
The depth of the camera is 10000.
This is my result:
If it's a game maker or a setting problem, please help me if you know anything about that, it could be because I changed the windows 8.1 preferences and those aren't valid as of yet, but they weren't before.
In the case that my code is wrong, here is my code:
Create event:
Code:
///Set variables
draw_set_colour(c_white);
d3d_start();
d3d_set_hidden(true);
d3d_set_culling(true);
draw_set_alpha_test(true);
draw_set_alpha_test_ref_value(239);
draw_set_color(c_white);
texture_set_repeat(true);
d3d_set_lighting(false);
x = 0;
y = 0;
z = 0;
zdir = 0;
dir = 0;
camx = x + lengthdir_x(100,direction);
camy = y + lengthdir_y(100,direction);
camz = 0;
spd = 0.1;
display_mouse_set(display_get_width()/2,display_get_height()/2);
model = d3d_model_create();
d3d_model_load(model, "garage.d3d");
tex = background_get_texture(tex_garage);
Code:
if keyboard_check(ord("W")){
x += lengthdir_x(spd,dir);
y += lengthdir_y(spd,dir);
}
if keyboard_check(ord("S")){
x -= lengthdir_x(spd,dir);
y -= lengthdir_y(spd,dir);
}
if keyboard_check(ord("A")){
x += lengthdir_x(spd,dir+90);
y += lengthdir_y(spd,dir+90);
}
if keyboard_check(ord("D")){
x += lengthdir_x(spd,dir-90);
y += lengthdir_y(spd,dir-90);
}
if keyboard_check(vk_space){
z += spd;
}
if keyboard_check(vk_control){
z -= spd;
}
if keyboard_check(vk_escape){
game_end();
}
Code:
dir -= (display_mouse_get_x()-(display_get_width()/2))/5;
zdir -= (display_mouse_get_y()-(display_get_height()/2))/2;
display_mouse_set(display_get_width()/2,display_get_height()/2);
camx = x + lengthdir_x(100,dir);
camy = y + lengthdir_y(100,dir);
camz = zdir;
d3d_set_projection_ext(x,y,z,camx,camy,z + camz,0,0,1,90,room_width/room_height,0,10000);
d3d_model_draw(model,0,0,0,tex);
This is my result:
Last edited: