Simple problem moving the camera...
Hello... I''m working on a simple program. I want the camera looking down the positive z axis... Not at any sort of angle...
I do however, want to move the camera up about 16 units on the y... I''m doing this:
gluLookAt(0.0f,16.0f,-10.0f,0.0f,0.0f,0.0f,0.0f,0.0f,0.0f);
Now the z appears to work because the camera moved back... the y however, doesn''t change at all.
Any thoughts? I don''t understand why this wont work.
Thanks!
-Dennis
You need a briefing on how gluLookAt works...
The first 3 arguements, 0.0f,16.0f,-10.0f in your case, describe where the camera is. ie. "I'm sitting next to my computer"
The next 3 arguements, 0.0f,0.0f,0.0f as you have them, describe what the camera is looking at. ie. "I'm looking at my monitor"
Finally, the last 3, 0.0f,0.0f,0.0f in yours, describe the direction up . ie. "My roof is up"
So what's your problem? First off, you haven't given up. It should be 0.0f,1.0f,0.0f.
Second, you moved the camera's location, but not where it's looking. Because the location is higher than what it's looking at, you'll be looking at an angle downwards! If you don't want that then raise the height of the camera's target by 16 as well.
Try this:
gluLookAt(0.0f,16.0f,-10.0f, 0.0f,16.0f,0.0f, 0.0f,1.0f,0.0f);
------------
MSN: nmaster42@hotmail.com, AIM: LockePick42, ICQ: 74128155
"It's all part of the conspiracy of conspirators conspiring to conspire their own conspiracies..."
[edited by - LockePick on December 17, 2002 12:13:24 AM]
The first 3 arguements, 0.0f,16.0f,-10.0f in your case, describe where the camera is. ie. "I'm sitting next to my computer"
The next 3 arguements, 0.0f,0.0f,0.0f as you have them, describe what the camera is looking at. ie. "I'm looking at my monitor"
Finally, the last 3, 0.0f,0.0f,0.0f in yours, describe the direction up . ie. "My roof is up"
So what's your problem? First off, you haven't given up. It should be 0.0f,1.0f,0.0f.
Second, you moved the camera's location, but not where it's looking. Because the location is higher than what it's looking at, you'll be looking at an angle downwards! If you don't want that then raise the height of the camera's target by 16 as well.
Try this:
gluLookAt(0.0f,16.0f,-10.0f, 0.0f,16.0f,0.0f, 0.0f,1.0f,0.0f);
------------
MSN: nmaster42@hotmail.com, AIM: LockePick42, ICQ: 74128155
"It's all part of the conspiracy of conspirators conspiring to conspire their own conspiracies..."
[edited by - LockePick on December 17, 2002 12:13:24 AM]
Actually, I am only new to openGL, but the 4th,5th, and 6th arguments should be (0.0, 0.0, 1.0).
The 7th, 8th, and 9th arguments should be (0.0,1.0,0.0).
Hope this helps
The 7th, 8th, and 9th arguments should be (0.0,1.0,0.0).
Hope this helps
quote:
Actually, I am only new to openGL, but the 4th,5th, and 6th arguments should be (0.0, 0.0, 1.0).
No, LockePick has it right, the eye point is at 0,16,-10. In order to look along the z axis it will need to look at a point on the line where x=0 and y=16 (ie 0,16,0 is suitable).
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement