- Joined
- Mar 28, 2008
- Messages
- 666
- Reaction score
- 20
- Points
- 33
Hello together,
I'm just trying a bit with openGL.
My goal is to create a "flying camera" which can move as a spaceship with RCS controll (internal view), but with only one fix spd (Camera is moving with 1 unit/s (with constant speed) or camera is not moving. (if no button/key is pressed)
Im using gluLoookAt (see here).
My problem now is, that openGL is an absoloute world.
This means, by the standart function, I can rotate and translate the world around it 0/0/0 coordinate.
I have no Idea how to reach my goal :-(
So for the first step, I have the following questions:
1. Is gluLookAt the right way to do this?
1. how to get it rotating in the right way?
2. how to get the translation related to the rotation angle (not absolute)?
I'm just trying a bit with openGL.
My goal is to create a "flying camera" which can move as a spaceship with RCS controll (internal view), but with only one fix spd (Camera is moving with 1 unit/s (with constant speed) or camera is not moving. (if no button/key is pressed)
Im using gluLoookAt (see here).
Code:
gluLookAt(
pos.posX, pos.posY, pos.posZ, //Position of camera
pos.posX, pos.posY, pos.posZ + 1, //Point where the camera is looking too
0, 1, 0); //Up - Vector
With this code, it's possible to translate, but not to rotate.
This means, by the standart function, I can rotate and translate the world around it 0/0/0 coordinate.
I have no Idea how to reach my goal :-(
So for the first step, I have the following questions:
1. Is gluLookAt the right way to do this?
1. how to get it rotating in the right way?
2. how to get the translation related to the rotation angle (not absolute)?