3D Flat sprites in a 3D game

CoderJoe

Member
Take a look at the help section in the gamemaker manual (click the question mark button at the top of gamemaker). This should help a little with 3d in gamemaker (as gamemaker is not really for making 3d games but it certainly is possible). There is a thing called bill boarding which basically creates a 2d image in a 3d world. I forget exactly how it works but a quick google search should help.
 

Fredrik

Member
I'm also working on a 3D dungeon crawler game with thise type of style, and I've done it something similar to this this:
Code:
  var tex;
  tex = sprite_get_texture(spr_ironsword,0);
  d3d_draw_wall(
        x-global.itmsize1*global.camsin,
        y-global.itmsize1*global.camcos,
        z2-global.itmsize2,
        x+global.itmsize1*global.camsin,
        y+global.itmsize1*global.camcos,
        z1,
        tex,1,1
        );
 

zircher

Member
Billboards are simple models (literally two triangles to make a rectangle), but they have logic to always rotate the flat side to the camera/player. In the above example, they would only have to rotate on one axis (vertical) since game play is on a flat floor. Unlike sprites, if you wanted to animate them would would have to manually assign new images to the model for each frame you wanted to update.
 
Thanks for the tip, the billboard term help me to do a better search. I played a bit with transformation and from the code:

Code:
d3d_transform_set_identity();
a+=1;
d3d_transform_add_rotation_z(a);
d3d_transform_add_translation(x,y,0);
d3d_draw_wall(-12,-16,0,12,16,32,tex,1,1);

d3d_transform_set_identity();
I got this:
test3d.png
That is fine, but with one problem, when 2 flat are "overlapping" , one of the them are erased (just look the 2 circles in the right side). Is it a way to solve this glitch or need rethink the design in other way?
 
Top