Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

I'm stuck on trying to figure out how to rotate the viewport(or camera). So far I've figured out I need to use the function glRotatef and glMatrixMode(GL_MODELVIEW). But I have no idea how to apply the rotations to the model view. I'm sorry I have no code to show because I have no idea how to get started. Any help would be greatly appreciated!

share|improve this question
    
Instead of rotating the camera, you can rotate an object as well. But for the reference, you can check out this project made by me. Hope this will clear most of yor queries. code.google.com/p/3dtouchmovingcube –  Sid Dec 28 '12 at 11:49
1  
You should just read any tutorial. –  Bartek Banachewicz Dec 28 '12 at 13:41
    
What are you talking about. Most tutorials I find don't cover camera work... –  opiop65 Dec 28 '12 at 15:22

1 Answer 1

glRotatef should apply to whatever matrix is currently selected by glMatrixMode. Just execute it after glMatrixMode.

It's worth nothing that glMatrixMode is a deprecated command. The new way of doing things involves using shaders, binding a matrix to them and multiplying them together with the vertex coordinates.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.