简体   繁体   中英

gluLookAt doesn't work

i'm programming with opengl and i want to change the camera view:

...

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? thanks

gluLookAt modifies the current transform matrix, so it only has effect on things rendered after the call. Try putting gluLookAt before your rendering code.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM