Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

grassgrass

OpenGL 3d model in 2d opengl

This topic is 5228 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

if i have a 3d model, how can i do that make this model in 2d opengl, for example, i want to place this model in centre of screen whatever i move in the 3d scnese?

Share this post


Link to post
Share on other sites
Advertisement
Guest Anonymous Poster
what if i need to load a 3D model, such as md3?

Share this post


Link to post
Share on other sites
I would like to suggestr that the code in the initial post be changed to:



void glSwitchTo2D( void )
{
GLint vPort[4];

glGetIntegerv(GL_VIEWPORT, vPort);

glMatrixMode(GL_PROJECTION);
glPushMatrix();
glLoadIdentity();

glOrtho(0, vPort[2], vPort[3], 0, 1, -1);
glMatrixMode(GL_MODELVIEW);
glPushMatrix();
glLoadIdentity();
}



Note: glOrtho(0, vPort[2], vPort[3], 0, 1, -1);

This allows you to use regular cartesian coordinants starting at the top-left corner.

EDIT: corrected a code mistake. transposed the 1 and -1

[edited by - psyjax on June 1, 2004 3:23:08 PM]

Share this post


Link to post
Share on other sites

  • 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!