PDA

View Full Version : Maya style camera



04-02-2006, 04:47 PM
In my program I implemented a maya style camera. I would like to add a reset button to it. However my problem is that I would like to be able to reset the scene several times. At the moment I set a boolen variable = false when a button is pressed, which then calls the following code in my DrawGLScene function:

if (reset == false)
{glLoadIdentity();
gluLookAt(...);}

is there a better way of doing this because at the moment I can only reset the scene once (cause as soon as I press the button the Boolean value goes to false) and even if I use the same Translation&Rotation functions afterwards it is still a bit awkward. I am pretty new to coding and just can't think of another way. Could anyone help to do this in a nice way a beginner would understand?? Thanks!

Komat
04-02-2006, 06:30 PM
Why do you not restore original value (true in your case) of the reset variable after you reset those matrices? Another thing: If variable meaning indicated by name is that something should be reset then it is better if variable is true when it should be done and false otherwise.