Vectors rotations 3D camera tiliting -
hopefully easy answer, cannot it.
i have 3d render engine have written.
i have camera position, lookat position , vector.
i want able "tilt" camera left, right, , down. camera on fixed tripod can grab handle , tilt it up, down, left right etc.
the maths stumps me. have been able forwards/backwards dolly , up/down/left/right panning, cannot work out vector math tilt.
for left , right tilt want rotate lookat position around camera position, need take account vector, otherwise rotation doesn't know axis to turn around.
the maths/algorithm need along lines of...
camera=(cx,cy,cz) lookat=(lx,ly,lz) up=(ux,uy,uz)
rotatepointaroundvector(lx,ly,lz,ux,uy,uz,amount)
can assist maths involved?
many thanks.
you make point infront of camera, rotate around camera (using trig) , use lookat() rotate camera.
this wont work once have start using roll (rotation around z). might wanna create quaternion based camera class. link helped me: gpwiki.org/quaternion...
Comments
Post a Comment