Saving and restoring OpenGL model-view

Posted by Tom on Stack Overflow See other posts from Stack Overflow or by Tom
Published on 2011-03-08T23:46:58Z Indexed on 2011/03/09 0:10 UTC
Read the original article Hit count: 156

Filed under:
|
|

I am a new-comer to OpenGL, and much of it remains mysterious to my feeble brain. I have been studying the NeHe demos as well as the Red Book. I am writing an Android application that displays the Earth in the center of the screen. The user can rotate the Earth about any axis (much like a very simple "Google Earth").

This code is working (I based it on the NeHe examples). Now I want to add a feature; the user should be able to save the current model orientation, then later return to that same orientation. For example, the user may save the Earth orientation such that the viewer is looking down at her hometown, and north-east is "up".

How do I do this with OpenGL-ES? To capture and save the current orientation, my code could get the current model-view transformation matrix - I think I understand how to do that. But later on how do I apply that saved matrix to restore the view?

© Stack Overflow or respective owner

Related posts about android

Related posts about opengl