For Terragen and Maya users

Started by digitalguru, July 14, 2016, 07:03:34 PM

Previous topic - Next topic

digitalguru

#15
well the camera is on its side when I import the chan into a new camera, but obviously I can't see how that relates to your Terragen scene

is it possible to send  the Terragen scene so I can bake it out myself to check?

QuoteI've kept rotate order as xyz.

in Maya or Terragen?

p.s

is this scene flying off into space?

if the .chan file was output from Terragen, I just entered the numbers into a Terragen camera and it's in orbit around the planet...


ajcgi

The planet is Mars ;)
Here's a very stripped down scene, but the basics are there. As I'm using MOLA data I am positioning the cameras in a fiddly, not-at-N-Pole way for each shot. Can't explain too much without breaking NDA. :)

XYZ rotation in both scenes

ajcgi

Before I forget, this is TG3 on win7 x64 , and Maya 2015 x64 on Linux

digitalguru

aha! well I did put the script out there so people could test it and see if they could break it  :o

obviously one of the things I hadn't anticipated was a camera going into orbit around Mars  :)

will have to have a think about this one....


ajcgi

Haha, we all like a challenge! It's a fun project this. It will be nice to share more info later in the year. Really pushing my knowledge of Terragen, and it appears, Maya. ;)

KyL

Quote from: digitalguru on July 15, 2016, 09:15:54 AM

If you can't see it check under Display/Heads Up Display form the MAya menu to see if there is an item called Camera Speed

if that's not there then make sure the code has been added to your userSetup.mel:

source "tgdUtils"; tgdUtils();

which loads the heads up display when Maya starts up

I didn't realized it was sourced from your script I thought this was built into maya! Very nice to include that it's going to be really helpful.

I will for sure make extensive use of your script on my next project :)

digitalguru

Hey ajcgi,

Thanks for spotting that, one of the reasons for putting the script out there was that others users would try things I wouldn't necessarily think of testing - like rendering planets!

I've attached an update to the script, try it out and see how you get on.  Also included some scene files used to test it out.

Couple of notes about the script:

The script was written so that everything should work with the default setup in Terragen, so you don't have to adjust anything to get the pipeline working (well, not now hopefully).

For instance, a default Terragen camera uses "Use horizontal fov" as its Perspective setting, you don't need to change this, just adjust the Focal length for your shot. (although when writing out a .chan file, Terragen converts the fov to vertical before exporting).

When you import a .chan file into Terragen it changes to "Use vertical fov". Leave the "Source rotation order" to "ZXY (Nuke Default)".

When you import a .chan file into a Terraman Basic Camera in Maya, the rotation values might look different, as the script converts rotation order on import.

I changed one of the rotation orders in the import camera in the script and it works with your scene now, though on your original camera it's a bit off. I think that may be a precision error since the camera is so far away from the origin.

There's a good page on it in the Terragen Wiki.

They suggest making sure the North Pole of the planet is centred on the World origin to minimise any problems with coordinate accuracy, so I tried it in a new scene with the recommended position and it lines up well between Maya and Terragen. (MarsNew_v01.tgd).

I'd also try on of the smaller scales when importing the planet - like 1:1000 or even 1:10000, you can always export the Maya camera manually and scale it up for the 1:10 scenes.

Have a go with it (try with a new Y position of the planet), please let me know if it works.

Get the test files from:
https://dl.dropboxusercontent.com/u/81475291/mars_scene_files.rar

DG

ajcgi

Thanks! :)
Will give it a go now. Moving the camera to the North Pole is what I'd ordinarily do, but I'd like to avoid it in this instance as it gives us flexibility to move around the planet. MOLA data can't be rotated, translated etc without going via Global Mapper.
When it comes to static cameras, the camera is easily interchanged using FBX into Maya, but occasionally I'm wanting to get animated cameras in and out for various reasons, hence looking at your script.

ajcgi

Ok, so that's much better! My horizon is roughly where I'd expect it to be. Won't have a chance to test it much in the next week or so but I'll let you know how I get on. Thanks ever so much! :D

digitalguru


Hetzen

Hi AJ, I think I know which project you're working on ;) Just a word of warning, you are going to get lots of floating point errors the further away you get from the origin. Just a fraction off in rounding co-ordinates and rotation is going to make a big difference when you start getting towards the equator. Things will drift between apps. You really should try and adjust your data to the pole.

ajcgi

It lines up with FBX. Don't worry about my floating points. ;)
Atm I'm effectively doing a sequence of RnD shots running over thousands of kilometres so realigning and adjusting to feedback each time would be a ballache. I've had rounding errors before on other projects and that's one of the reasons why our Maya stuff is smaller than real life. So far so good, but as soon as I get misalignment it will be into Global Mapper to reorient to the North Pole. Aside from anything, another bonus of being at the North Pole is that cloud altitude is actually where you'd expect it to be. The coords of a localised cloud is done in global space, not in relation to the centre of the planet, ie Y is up, not out.

Hetzen

I'm glad you're comfortable with your floating points. :D

There's all sorts of advantages being at the pole like you mention. Scaling between apps get's you so far but I think you'll find that you'll have to convert quite a lot of any ground shots (if any) you're doing as you really don't have to travel too far from TG's origin to see mismatches. Just a heads up.

Btw, the cloud altitude does work from the planet center outwards, it's the placement of the localised region that is in world space. If you copy co-ordinates on the side of the planet and paste them into your cloud layer, adjusting the altitude will change the x,y,z of the localised centre of the cloud.

ajcgi

Yeah that's kinda what I meant. :P
Normally I do everything at the North Pole. Hopefully one day when I'm not on NDA I can fully explain why I'm not. ;)

decksounds13

Is there another location to get the scene files?  The dropbox link is broken...