PeasyCam Conical Movement
in
Contributed Library Questions
•
2 years ago
I am attempting to use the PeasyCam library to accomplish a birds eye view of my subject matter while constantly rotating in a circular movement above it. The camera should maintain a downward view towards the subject while essentially tracking in a circle.
At first I tried simply rotating the camera from looking directly towards my subject plane to the downward angle I desired. I then tried to apply a continual camera.rotateZ(value) in the draw loop, but since the peasycam library uses a type of arcball matrix transformation, it simply causes that current view to be rotated on the new Z axis instead of the world Z axis.
I could use a sin/cos function to make the camera orbit the subject plane by continually updating its position on each frame, as well as update the camera.lookAt() to make sure it is constantly pointed at the same x/y/z position of my subject, but I have my doubts about how the roll of the camera will be handled.
Some people may suggest simply doing a translate to center everything in the world and rotating the subject itself, but I would ideally like to keep all view changes isolated within the camera object.
Has anyone had experience doing this?
At first I tried simply rotating the camera from looking directly towards my subject plane to the downward angle I desired. I then tried to apply a continual camera.rotateZ(value) in the draw loop, but since the peasycam library uses a type of arcball matrix transformation, it simply causes that current view to be rotated on the new Z axis instead of the world Z axis.
I could use a sin/cos function to make the camera orbit the subject plane by continually updating its position on each frame, as well as update the camera.lookAt() to make sure it is constantly pointed at the same x/y/z position of my subject, but I have my doubts about how the roll of the camera will be handled.
Some people may suggest simply doing a translate to center everything in the world and rotating the subject itself, but I would ideally like to keep all view changes isolated within the camera object.
Has anyone had experience doing this?
1