X and Y coordinates and OpenGL
I've just began OpenGL and gotten to texture mapping and all, but I was curious... Can you make the X and Y values optimized for 2D (Ex. 300x200 instead of 1.0fx0.0f)?
Yes. Switch to ortho mode and then you have it. Use the something like that glVertex2i. (i) stands for integer.
If it's for texture coordinates, I guess you could just add a texture matrix transform:
HTH.
[Edited by - Zongo on December 18, 2005 4:10:19 AM]
glMatrixMode( GL_TEXTURE );glScalef( 1.f / size_texture_X, 1.f / size_texture_Y, 1.f );glMatrixMode( GL_MODELVIEW );// Draw your 2D stuff here ...// Restore the texture matrix for 3D drawingglMatrixMode( GL_TEXTURE );glLoadIdentity();glMatrixMode( GL_MODELVIEW );
HTH.
[Edited by - Zongo on December 18, 2005 4:10:19 AM]
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement