Maya to Terragen - camera problem

Started by dcn, July 16, 2012, 06:57:38 PM

Previous topic - Next topic

dcn

Hope someone can help as I've spent three days banging my head against a wall with this one.

I've got the dreaded slippage when I'm compositing some matchmoved footage over a Terragen scene.  The solve is solid as a rock in Maya, I export the camera data as a .mov with 8 columns (frame, xyz position, xyz rotation and vertical field of view), rename it as a .chan and bring it into Terragen.  And it almost works, but not quite. 

Sticking in a basic checkerboarded ground plane in Maya, rendering that out and comping it beneath the live action footage proves to me that the matchmove worked, I just can't see where the camera move is going wrong between Maya and Terragen.  The film back and the focal length are correct and the shape of the movement in the Animation graph window matches what I see in Maya (although obviously some axis are inverted when Terragen interprets the .chan).

Really stumped.  I presume that people have gone 'Maya > .chan > Terragen > composite' before without issue so I'm guessing I'm making some basic mistake.  Anyone care to share their workflow?

Oshyan

#1
There are two major causes that come to mind for this (there may be others as well, these just seem to be the most likely). First would be rotation order, which you've probably thought of. Some discussion of TG2's rotation order here: http://www.planetside.co.uk/forums/index.php?topic=13730.msg135056#msg135056
It is of course critical that the rotation order be the same or be mapped correctly between different systems, and note Matt's last post in that thread on the added challenges of doing with differing coordinate systems:
Quote
It gets even more tricky to keep track of the differences when different programs have a different XYZ system. For example, if the Y axis in one program is equivalent to the Z axis in another, then to match a rotation order of 'ZXY' in the first program you'd need to use a rotation order of 'YXZ' in the second, because Y is really Z.

The other major possibility could be numerical accuracy. If you're working on a scene with very large scales, or working very far away from the coordinate origin, you can run into issues with a lack of precision in position values due either to exporter limitations, or simple numerical limitations.

I don't have any experience with this stuff myself unfortunately, so I probably can't be of tremendous help, but if you can post a sample CHAN/MOV file and some more details about your scene, possibly one of the rendered frames for reference, then hopefully we can resolve it. I'll have Matt take a look at this discussion once there's more info to go on.

Edit: I see you submitted some more details in the support email, so I'll work with Matt on that.

- Oshyan

dcn

Thanks Oshyan.  Of all the threads I've read over the last few days that wasn't one of them.  I did find something about the ZXY order but that was in a post from 5 years ago so I'd assumed that it might not be the current way of doing things.  Will investigate more.

The scene has rather modest movements so thankfully the distance from the origin is not an issue.

Once I've cracked this I'm going to attack the wiki on this subject!

Oshyan

Adding some info in the wiki would be fantastic and much appreciated! I'm afraid I don't have access to many other 3D apps, nor knowledge of them, from which to create such docs myself. But we should indeed put down more concrete info in the wiki about the way TG does things in terms of coordinate system and rotation order; that way at least people should be able to work out conversions, provided they know their primary app's info in the same way.

- Oshyan

jo


Oshyan

To my embarrassment, I had forgotten about that. It's definitely a lot of good info!

- Oshyan

dcn

Hi Jo,

I'd seen all that info scattered around (mostly in posts from Matt) but not all together in the wiki so thanks for that.

I'm now convinced it's a xyz > zxy issue and I've managed to get 'almost' perfect tracking when comp'ing the Terragen output and the Maya output together.  Why it's not quite as rock solid as a direct Maya output I'm going to tackle today.

I'll definitely do a tutorial when I'm done.  Partly because if I don't have to do this for a while and then forget a step, I'd kick myself.