I am using a UniversalCamera when displaying a scene. This camera works well for user control. I can also move and set the camera’s rotation instantly to any specified location and rotation. I can even smoothly move the camera from one location to another by generating keyframes using a curve and feeding that to an animation. But I can’t seem to figure out the best way to generate smooth rotation keyframes given a starting rotation and an ending rotation. So, I have two questions:
Is there a simple way to animate the position and rotation of a camera given starting and ending position and rotation information?
What is the best way to generate rotation keyframes that can be used in an animation sequence?
Thank you, this is exactly what I am looking for. However, I am having trouble modifying the example to work with a UniversalCamera. Here is the updated PG:
It seems like it is not able to recognize a child property of rotation.
Looking up the starting value is a little trickier when the target property is nested (e.g. “rotation.x”). Here’s code to do it that I derived from the RuntimeAnimation’s _preparePath function.
Edit: couldn’t resist simplifying it a little more.