Jump to content
  • Advertisement
Sign in to follow this  
dist0rted

OpenGL X and Y coordinates and OpenGL

This topic is 4688 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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)?

Share this post


Link to post
Share on other sites
Advertisement
If it's for texture coordinates, I guess you could just add a texture matrix transform:


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 drawing
glMatrixMode( GL_TEXTURE );
glLoadIdentity();
glMatrixMode( GL_MODELVIEW );


HTH.

[Edited by - Zongo on December 18, 2005 4:10:19 AM]

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!