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.
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
-
158.6 KB Views: 10
-
170.7 KB Views: 10
Last edited by a moderator: