opengl execute in reverse order

opengl executes code in reverse order

insert image description here
So if we want to rotate the text around the z axis, and then around the y axis, the code should be as follows:

void Draw3d()
	{
    
    
		glPushMatrix();
		glDisable(GL_BLEND);
		_dgiOgl3d->DrawCoordinate();
		_dgiOgl3d->DrawGround(DGITextureManager::_GROUND, 200, 200);
		_dgiOgl3d->SetTexture(DGITextureManager::_WALL);
		glEnable(GL_TEXTURE_2D);
		glColor3f(1, 1, 1);
		//uint8_t * t = _Video.QueryFrameInternal();
		//_dgiOgl.ReplaceCanvas("video", t);

		//uint8_t *t2 = _RtspDecoder.GetDecodeBuffer();
		//_dgiOgl.ReplaceCanvas("DHAU", t2);

		_dgiOgl3d->DrawCanvas();

		glPopMatrix();
		glPushMatrix();
		//GLfloat x = _move[0].lt.x;
		//GLfloat y = _move[0].lt.y + 1;
		//GLfloat z = _move[0].lt.z;
		//glTranslatef(x, y, z);
		//glRasterPos3f(x, y, z);
		glTranslatef(0, 0, 80);
		glRotatef(90, 0, 1, 0);
		glRotatef(90, 0, 0, 1);
		//glRotatef(90, 0, 1, 0);
		//glRotatef(90, 0, 0, 1);
		_dgiOgl3d->DrawTitle(0, 0.0f, 1.0, L"测试以我是一个中国人为值");
		//glEnable(GL_BLEND);

		glPopMatrix();
	}

The code is executed as follows

1 glTranslatef(0, 0, 80);
2 glRotatef(90, 0, 1, 0);
3 glRotatef(90, 0, 0, 1);

On the event, execute 3 first, then execute 2, then execute 1

Guess you like

Origin blog.csdn.net/qianbo042311/article/details/127678725