• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

3D Wrong sides of 3D cube being drawn

S

SilentX

Guest
I'm working on a new 3D puzzle game for iOS.

When running the game on my iPad, it appears that sometimes, a few sides of a 3D cube, which are drawn last, will appear in front of other sides, even if they are on the opposite side of the cube. Each cube is made of 6 primitives.

Here is how one side of a cube is created:
d3d_model_primitive_begin(obj_landscape1.model[2],pr_trianglefan)
d3d_model_vertex_texture(obj_landscape1.model[2],x,y,zed2,0,0)
d3d_model_vertex_texture(obj_landscape1.model[2],x,y,zed1,1,0)
d3d_model_vertex_texture(obj_landscape1.model[2],x+sprite_width,y,zed1,1,1)
d3d_model_vertex_texture(obj_landscape1.model[2],x+sprite_width,y,zed2,0,1)
d3d_model_primitive_end(obj_landscape1.model[2])

Here is the code to draw all the primitives within a model:
d3d_model_draw(model[2],0,0,0,sprite_get_texture(spr_block1,0))

This is very similar to a problem I recently had, except that instead of some sides not being drawn at all, I have sides on the opposite side of a cube being drawn over the top of the side closest to the camera.

It displays perfectly on my laptop, but incorrectly on my iPad.

I'm not sure how to fix this, as there will always be a side of the cube drawn last, with the camera on the opposite side.

I have game maker studio 1.4.1598 installed. When using the latest version of game maker, I had other issues when exporting the game in Xcode, so I rolled back to this version.

I have attached 2 images demonstrating the issue.
 

Attachments

Last edited by a moderator:
Top