🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

need to redraw model?

Started by
2 comments, last by dpatte 23 years, 11 months ago
Everytime we want to change a viewing angle, is it necessary to draw the complete model again, or is there a way to have it automatically redraw the last model when we change the camera angle? Thanks
Advertisement
Hi ... There''s no such thing as camera in ogl, we can only imagine our own camera, so everytime you move it you acctually move whole ''world''... and there''s no magic way you can use last frame to create new one... except ... display list ( check tutorial to find out more ) it''s like equivalent of a compiler : you display ( compile ) model once and then use it as it is ( no single vertex moves allowed )
saves speed ...



Pet
Pet
Thanks

so , if i change the modelview matrix, i then must set all my vertices again, or use a display list? (newbie here
u should have in your code someit like

Model car,house;

position camera
glPushMatrix();
move to the cars position and rotate
car->draw();
glPopMatrix();
glPushMatrix();
move to the house position and rotate
house->draw();
glPopMatrix();

etc

the draw function can be anything a display list, intermediate mode eg glVertex3f(...) ... , draw elements etc.
though of course with a display lisdt u only compile everything that u want to be drawn there once at the start of the program

This topic is closed to new replies.

Advertisement