View Full Version : You dont understand
04-24-2001, 04:14 PM
No, what i mean is that if ipress either of the keys the scene zooms out, even if i press the forward key.
04-24-2001, 04:17 PM
oops, i pressed post new instead of reply... My problem is that when i assign 2 keys, one to increase the value of a variable called movement, the other to decrease, and then i say
gluLookAt(0.0, 0.0, movement,
0.0, 0.0, movement-1,
0.0, 1.0, 0.0);
no matter which key i press, the scene zooms out, why
Ok, managed to figure out it was my reply you was trying to answer. Guess we can go on in this thread then.
First, your keyboard routine can be messed up. Are you sure you are not increasing the value, by mistake, on both keys?
Another problem can be that you aren't resetting the modelview matrix before calling gluLookAt. This way, your movements will be added each frame, instead of loading a new position each frame.
Post some code, including everything that affects the movements. It's usually easier locating a problem when looking at the code.
Powered by vBulletin® Version 4.2.3 Copyright © 2017 vBulletin Solutions, Inc. All rights reserved.