I'm having some trouble getting d3d transformations down. Some game elements are billboarded sprites, however, they appear mirrored, and I can't figure out how to fix them.
This is my ground texture.
This is how I want it to appear. Top left is north in-game, so it would make sense that the top of the texture is pointing that direction.
This is how it appears in-game
I understand that d3d drawing is different than 2d drawing. Could someone explain how to compensate so that it doesn't get flipped? I know how to disable backface culling, but it's a bad practice because it draws twice as much as it needs to.
Here is the relevant code I'm using.
This is my ground texture.
This is how I want it to appear. Top left is north in-game, so it would make sense that the top of the texture is pointing that direction.
This is how it appears in-game
I understand that d3d drawing is different than 2d drawing. Could someone explain how to compensate so that it doesn't get flipped? I know how to disable backface culling, but it's a bad practice because it draws twice as much as it needs to.
Here is the relevant code I'm using.
Code:
//Camera projection
//cam_xoff=-1000
//cam_yoff=1000
//cam_zoff=1500
d3d_set_projection(cam_x+cam_xoff,cam_y+cam_yoff,cam_zoff,cam_x,cam_y,0,0,0,1)
Code:
//Drawing the floor
draw_set_color(c_white);
//draw_set_color(make_colour_hsv(0,100,clamp((floor_noise[i,j]+1)*255,100,255)));
d3d_transform_set_identity();
d3d_set_depth(0);
d3d_transform_add_translation(i*128,j*128,-15)
d3d_transform_add_rotation_x(0)
d3d_transform_add_rotation_y(0)
d3d_transform_add_rotation_z(0)
d3d_draw_floor(0,128,0,128,0,0,background_get_texture(background17),1,1)
d3d_transform_set_identity();
Last edited: