PDA

View Full Version : camera



07-24-2000, 10:35 AM
Ok a simple (maybe camera (viewing) question

I want to have the camera (I know there really isn't one)

anyway

I want a user to have complete control of the camera....

That the camera can be positioned and oriented in the following manner


It can be put in any x,y,z position (world coordinates)
It can be rotated in along any axis
(roll pitch yaw)
It can be translated wrt its current orientation
It can be rotated wrt its current orientation


An example....

The camera starts at the world origin...
the user says they want it a 0,100,0 (world)

then they rotate it 90 degrees wrt pitch (x axis)

now if they move forward they will move down (world coordinates)

if they roll the camera it will rotate wrt y axis (world cooridinates) etc

This should work for arbitrary rotations and translations

Thanks in advance

Relic
07-26-2000, 11:44 AM
This is a typical case for the use of quaternions to store the orientation of the camera in 4 floats (representing a rotation axis and an angle). Linear interpolation between quaternions results in nice rotational changes of the orientation.
Issue a search about cameras and quaternions.
There were some other threads with that topic on these boards.