Skip to main content
GameDev.net gamedev.net
🔒 Locked

OpenGL Selection Buffer/Ortho Mode Problem

Started by rage989 Mar 11, 2005 at 1:00 PM 3 replies 800+ views
Original Post
rage989
rage989
Hello, I am having difficulty making the selection function of openGL work in ortho mode. It works fine when I am in 3D mode, but when I then change to ortho mode to render user interface components, it seems like they take up the entire screen, everywhere you click is the first object I render, in ortho mode. Does anybody have any idea's as to why this might be happening? Thanks in advance, raj.
jake_Ghost
jake_Ghost
i was having a big problem as well while using glOrtho, heres how i wrote it so that it would not mess up the modelview matrix.

	glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);	glMatrixMode(GL_MODELVIEW);	glLoadIdentity();glDisable(GL_DEPTH_TEST);	glMatrixMode(GL_PROJECTION);	glPushMatrix();		glLoadIdentity();		glOrtho(0,1024,0,768,-1.0f,1.0f);		glMatrixMode( GL_MODELVIEW );		glPushMatrix();			glLoadIdentity();                        // draws stuff here			glMatrixMode(GL_MODELVIEW);		glPopMatrix();		glMatrixMode(GL_PROJECTION);	glPopMatrix();	glEnable(GL_DEPTH_TEST);


hope this helps
rage989
rage989
When do you call your gluPerspective function?
jake_Ghost
jake_Ghost
i call that at initialization

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.