export to 3ds max

Started by Reinis, July 10, 2011, 01:47:34 PM

Previous topic - Next topic

Reinis

Hello

How to import TG2 terrain exported .LWS/O in 3ds max 2012?

Tangled-Universe

Hi and welcome,

Looking at your question I assume you already figured out how to export your terrain?
I normally save my terrain export as .obj.

In max make sure that max and system units are both set to meters.
Then in max I import the object via the main "file --> object" menus.

The object will be placed in the same coordinates and scale as in Terragen 2.
That will mean that if your exported terrain is far away from the origin in TG2 (origin in TG2 is coordinates 0,0,0) that it will also be far away from the origin in max and probably not visible upon importing because it's outside the default viewport.

How to deal with this:
1) It's best/easiest to set up your scene and camera in TG2.
2) Then write down camera coordinates. For example 1500, 20, 300.
3) Create a "transform shader" in TG2 and hook it up as the very last shader before the planet-node. Make sure you use the connect at the right for the transform shader.
4) Inside the transform shader set the translate values to -1500, 0, -300.
5) Go to your camera and change the coordinates to 0, 20, 0.
6) Now both terrain and camera are aligned the exact same way as before but only at the origin coordinates except for altitude/Y. This works well enough.
7) Export and import terrain and it should show up.

Cheers,
Martin

freelancah

Hmm didn't Walli make a video tutorial about export to maya/3d max ? Or is my memory going corrupt? :P


Reinis

Thanks for replies

In video tutorial he does export .LWO sequence and in 3ds max import part he does already have .obj file ready.

So;
Heightfield export LWO - this generates LW sequence files but i'm not able to import anything from them into 3ds max 'coz it gives import module error. Do i need Lightwave to convert this sequence to .obj?

Tangled-Universe

Wonder how much you read and/or understood from my reply...

Just follow my steps to prepare TG2's scene for export and continue with step 8

8) create a "micro exporter" `(right mouse button -> create other -> micro exporter)
9) double click on it and set the filename to something like "terrain.obj" (it automatically saves it as obj then)

The near and farthest settings control the distance over which TG2 will output the geometry.
The output of the geometry is based on what your render camera sees.

So what also works well is a 90 degrees down facing camera at 0, Y, 0 where Y is an appropriate altitude from where it can "see" the portion of the terrain you want to be exported.
If the altitude of your camera is 1000m then set farthest distance to something a bit bigger, say 1500m. Then all geometry up to 1500m away from the camera will be exported.

10) Once the micro exporter is configured you need to enable the export in the render node, so go to the render node
11) In the last tab, called "sequence/output", you need to enable the micro exporter by clicking on the green '+' sign then choose "assign micro handler" and choose "micro exporter 01". Don't forget to actually activate the output by checking the box to the left.

12) Now your export-camera and mesh export node are configured, all you need is to render your scene and with each render it will automatically save out the mesh. So don't forget to disable it after you're done with exporting, because.....

13) The number of triangles is determined by the render detail setting in the quality tab. For export a detail of 0.4-0.5 results in a nice mesh suitable for animating a camera-path or fluid-sims.
If you render with detail 0.8 or higher, for instance, the mesh will become VERY dense and the exported file will become very large and also will take some time.

These steps should guide you through the whole process...

Reinis

Finally i managed to import some terrain.
Thanks!

I bypassed step 3. it by manually changing camera to top view over terrain box and rendered it using micro exporter.

Also i have noticed that micro exporter generates empty file when i'm changing near/far distance slider or sometimes just for unknown reason.

Tangled-Universe

Great to hear it worked :)

In case you end up with (little) holes/gaps in your mesh, then go to the second tab in the renderer and disable "microvertex jittering" and "sample jittering".

Quote from: Reinis on July 11, 2011, 06:22:47 AM
Finally i managed to import some terrain.
Thanks!

I bypassed step 3. it by manually changing camera to top view over terrain box and rendered it using micro exporter.

Also i have noticed that micro exporter generates empty file when i'm changing near/far distance slider or sometimes just for unknown reason.

Step 3 is mainly meant for making sure your exported mesh shows up in Max and also for accuracy issues because you need to correct for planet curvature the further away you are from 0,0,0 in TG2. Besides that, inside TG2 the altitude coordinates become less accurate the further away from 0,0,0.
So enough reason to translate your region of interest to/near 0,0,0 before export (and keep it there anyway).

The reason that you can end up with an empty file is because the near/far distance are not set correctly.
By default it exports from 0 meters up to 1000km away from the camera (nearest = 0 and farthest = 1^E06), but in case you're not rendering a top/down view but an orbital render instead for instance, then you could end up with an enormous mesh.