Chirone
06-11-2010, 08:59 AM
This is probably going to seem like a stupid question but... how do i get objects to render as you'd expect them to in OpenGLES 2?
what i mean is...
i have two models, a cone and a cube
i have a program
it has a vertex shader and a fragment shader
both models use this program and shader
the cone is placed at (512, 384, 0) on screen
the cube is place at (512, 384, 60) on screen
the cone is made in a way that the cube should appear infront of the cone
in the drawing method i can draw the cone first and then the cube and the cube appears in front of the cone
if i switch them then the cone appears in front of the cube
how do i stop this from happening and make it so that the cube is always drawn in front of the cone regardless of when it is drawn in the draw method?
changing the z coordinate in the matrix that the vertex is transformed by doesn't appear to bring objects closer or push them further away. could this be why they are drawn as if they are on the same plane?
glEnable(DepthTest) is enabled
what i mean is...
i have two models, a cone and a cube
i have a program
it has a vertex shader and a fragment shader
both models use this program and shader
the cone is placed at (512, 384, 0) on screen
the cube is place at (512, 384, 60) on screen
the cone is made in a way that the cube should appear infront of the cone
in the drawing method i can draw the cone first and then the cube and the cube appears in front of the cone
if i switch them then the cone appears in front of the cube
how do i stop this from happening and make it so that the cube is always drawn in front of the cone regardless of when it is drawn in the draw method?
changing the z coordinate in the matrix that the vertex is transformed by doesn't appear to bring objects closer or push them further away. could this be why they are drawn as if they are on the same plane?
glEnable(DepthTest) is enabled
