Jump to content
  • Advertisement

Archived

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

Lombardix

2d and 3d

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

Hi I''m tryng to mix 2d and 3d in opengl, but nothing shows up in 2d Correct me if i''m wrong, but my code is something like this: x,y,x1,y1 are pixel coordinates glMatrixMode(GL_PROJECTION); glPushMatrix(); gluOrtho2D(0,0,800,600); // -->to make a window 800x600 pixels glBegin(GL_QUADS); glVertex2d(x, y); glVertex2d(x,-y); glVertex2d(-x,y); glVertex2d(-x,-y); glEnd(); glMatrixMode(GL_MODELVIEW); glPopMatrix(); and here, i have my code for a spining cube.. I sure i can simulate pixel coordinates.., it''s not logical to use space coordinates in 3d, is this correct? Where is the problem?? can anyone help me?? thanks Lombardix

Share this post


Link to post
Share on other sites
Advertisement
sorry.., i didn''t wrote correctly..
I push the matrix so i can preserve the 3d projection, then i make the 2d drawing, and then i put back the 3d projection...

Share this post


Link to post
Share on other sites
yes, i''m telling the color...
Can some nice soul teach me to draw 2d and 3d scenes at the same time in opengl??

Lombardix

Share this post


Link to post
Share on other sites
Keep it in projection mode, just draw the 2D images in the distance so you can see them...

Make sure to use "glDisable(GL_DEPTH_TEST)" and then re-enable it when you''re done drawing the 2D images.

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.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!