I have a working project of 2D texturemaps.
Using glOrthof(0, 320 ,0, 480 , -1.0f, 1.0f); everything is fine and works as desired.
I’d now like to be able to rotate some of the textures in x and y axis (flipping them on screen). (I’m already using the z-axis rotation)
Of course this requires perspective since the ortho is crushing everything. (x and y rotations just show the images as a bar)
If I switch out glOrthof and replace it with glFrustumf then no images show up.
I’ve probably have been working so long I’m overlooking something obvious. Not planning to turn it into a full 3D model, just to be able to flip some flat images.
I’ve tried different far/near parameters.
Do I need to:
setup depth buffers?
glEnable(GL_DEPTH_TEST); ?
glDepthFunc(GL_LEQUAL); ?
glClear(GL_DEPTH_BUFFER_BIT); ?
here’s the basic texture drawing code:
glBindTexture(GL_TEXTURE_2D, _name);
glVertexPointer(3, GL_FLOAT, 0, vertices);
glTexCoordPointer(2, GL_FLOAT, 0, coordinates);
glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
Do I need to supply a different value for z (other than 0) in the texturemap vertices?
Thanks.