[英]gluLookAt doesn't work
i'm programming with opengl and i want to change the camera view: 我正在使用opengl编程,我想更改相机视图:
... ...
void RenderScene() //Zeichenfunktion
{
glClearColor( 1.0, 0.5, 0.0, 0 );
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT );
glLoadIdentity ();
//1.Form:
glBegin( GL_POLYGON ); //polygone
glColor3f( 1.0f, 0.0f, 0.0f ); //rot
glVertex3f( -0.5, -0.5, -0.5 ); //unten links 3 =3 koords, f=float
glColor3f( 0.0f, 0.0f, 1.0f ); //blau
glVertex3f( 0.5, -0.5, -0.5 ); //unten rechts
glVertex3f( 0.5, 0.5, -0.5 );//oben rechts
glVertex3f( -0.5, 0.5, -0.5 );//oben links
glEnd();
Wuerfel(0.7); //creates cube with length 0.7
gluLookAt ( 0., 0.3, 1.0, 0., 0.7, 0., 0., 1., 0.);
glFlush(); //Buffer leeren
}
... ...
when i change the parameter of gluLookAt, nothing happens, what do i wrong? 当我更改gluLookAt的参数时,什么也没发生,我该怎么办? thanks
谢谢
gluLookAt modifies the current transform matrix, so it only has effect on things rendered after the call. gluLookAt修改当前的变换矩阵,因此它仅对调用后呈现的事物有效。 Try putting gluLookAt before your rendering code.
尝试将gluLookAt放在呈现代码之前。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.