View Full Version : Camera Rotation Problems

10-06-2004, 05:53 PM
Myself and a friend have written an LScript that exports a camera motion path to Doom 3's MD5camera format.

Everything works great provided you keyframe all the camera's movements (X, Y, Z, Heading, Pitch, Bank, FOV).

The problem is that if you were to set the camera up to target a null the rotation channels are not effected. Even though the camera rotates in Lightwave to face the target the rotational values remain at zero.

Now I'd like to point out again that this isn't a problem in the LScript. This is a problem with the values that are passed from Lightwave to the script.

You can also see this problem in the graph editor. The camera rotates to face the target however in the graph editor the rotation channel shows no change.

I've read here that you can bake rotational information in the graph editor like this...


But I've tried this exactly as it's done on the page and I still see no curves in the graph editor for rotation.

I think this is because targeting a null affects the camera itself but does nothing to the camera's rotation.

What I'd like to do is to bake the effect that targeting a null has to the rotation so that if I were to delete the null/rig from the scene afterwards that the camera would still follow the same path.

Is this possible? Am I doing something wrong that's preventing the camera's rotation channels from being effected?

I'm assuming the problem is that when the graph editor querys an object for it's channel data the curves displayed are relative and not absolute. In this case the rotational values are relative to the null meaning that the camera never changes orientation unless you keyframe a change manually.

Anyway, thanks for any help you guys can give me.

10-06-2004, 06:13 PM
google the Transmotion plugin, then look up the author and shoot him an e-mail. He has written a plugin that fixes this problem (i.e. can bake a camera with a target, even a parented one).

I'm pretty sure he wrote the plugin, if he didn't he knows of one that handles your problem.


10-06-2004, 06:59 PM
Scratch that. I think I have it figured out but my solution was related to LScript so maybe this topic should be moved.

Anyway, I was using getPosition and getRotation to obtain the values from the camera. I changed it to getWorldPosition and getWorldRotation and now it's outputting valid values.

The only problem now is that the values are sometimes in scientific notation and I need them all to be in decimal.

I tried rounding them off at the 6th decimal place but I still end up with scientific notation numbers.

BAH! Lscript can be frustrating at times.