Advertisement

Ortho view

Started by May 10, 2003 02:00 PM
1 comment, last by dario_s 21 years, 9 months ago
Hi, Im trying to draw a semi-transparent quad in orthoview mode... I can''t figure out what I''m doing wrong! Someone please help me!
  
	glOrtho(0,scrWidth,0,scrHeight,-1,1);						// Set Up An Ortho Screen with no z-buffer


	glMatrixMode(GL_MODELVIEW);									// Select The Modelview Matrix

	glLoadIdentity();

	glPushMatrix();											// Store The Modelview Matrix

		glDisable(GL_TEXTURE_2D);
		glEnable(GL_BLEND);
		glColor4f(1.0f, 0.0f, 0.0f, 0.1f);

		glBegin(GL_QUADS);
			glVertex2f(   0.0f,   0.0f);
			glVertex2f(   0.0f, 100.0f);
			glVertex2f( 100.0f, 100.0f);
			glVertex2f( 100.0f,   0.0f);
		glEnd();

		glEnable(GL_TEXTURE_2D);
		glDisable(GL_BLEND);
		glColor4f(1.0f, 1.0f, 1.0f, 1.0f);
	glPopMatrix();											// Restore The Old Projection Matrix

  
What is the problem? Is it not drawing at all? Not drawing quite what you expect? What?

A trivial problem could be not having a glMatrixMode(GL_PROJECTION) at the start of your snippet there, but I presume that''s simply a cut''n''paste omission.
Advertisement
Its working now, thanks anyway.

This topic is closed to new replies.

Advertisement