Importing terrain model from sketchup

Started by Talkietom, January 12, 2011, 03:32:01 AM

Previous topic - Next topic

Talkietom

Hi, I am a landscape designer. Looking to buy T2 for creating animated walkthroughs for a large, predominately fields, lakes and woodland, project. Can I import my sketch up terrain model into T2 and do all the wonderful things as shown in the demos? I don't need it to be completely accurate as it is a concept only. I assume I can get the surrounding OS or GIS data and stitch it to the model also to provide a fairly decent backdrop? We are Mac only and My software people are pushing me towards Lumion but that is PC only and you need a graphics card also. Is there any form of UK training also?
Thanks
Possible Newbie

Tangled-Universe

What are your options for export from Sketchup?
I presume you cannot export a heigthfield (a b&w bitmap, usually, which describes elevations by grey-values), but only can export to .obj or .3ds?
For both there are different options, so once we know this I can give you further suggestions.

Cheers,
Martin

Talkietom

Martin, thanks for getting back

We can export in: 3ds, collada, .kms (google earth), .fbx, .obj, all Autocad options, vrml, xsi

So yes on the obj and 3ds

I had a look at your site and you seem to be the man to talk to! The project is 175 acres and we have had it surveyed and already made the terrain model in SU. I have built the house in SU also and want to do a series of animated views to and from the house indicating that it is possible to see various features form the house ie lakes, woods etc.

Tangled-Universe

If I'm the man to talk to, I don't know as this is new for me too :) but...I do have ideas though.

So you can't export to a heightfield, so let's try to make a heightfield from your .obj
TG2 reads .obj files, but not 3ds (but you can easily convert other object standards to .obj, usually).
(I don't know if sketchup also exports textures. I'd add one texture, a plain color suffices, in order to create a texture channel which will show up automatically in TG2.)

Load the object in TG2 (top section called "objects" choose "load object" then "obj loader" and navigate to your exported terrain .obj file.
By default it is positioned at the "origin" which means position 0,0,0. Keep it there.
See if the scale of the model is correct. You can check this by using the measure tool, which you can find at the top of the preview render. It's a yellow measure.
If it doesn't have the right scale then adjust that in the object settings. For that, click on the object in object panel on the left.
You will see "translate" "rotate" and "scale" settings. Change the scaling accordingly for each axis.

To shade the object as a heightfield we need a function that gives black color at the bottom and white color at the top of the terrain.
We'll use a distance shader for this.
Go inside the internal network of your object. It's a symbol with 3 tiny squares, one at the top with 2 linked to it at the bottom.
Repeat that step until you can't go further.
You should see a "parts shader" now with a "default shader" attached to it (a grey node with a red one attached to it on top).

Now right click with the mouse and chose "create shader -> colour shader -> distance shader".
Create a camera by right click with mouse "create other -> create camera" and place the camera at coordinate 0,0,0.
The second line shows the rotations, enter 90, 0, 0 there. The camera is now facing straight up.
Double-click on the distance shader. You'll see a "far distance" and "near distance" setting.
Change the default 10000 to 0 and the 0 to the actual height of your model in metres.

To know the models altitude in metres you will need to finish the preview render completely and make sure you can see the highest point of your terrain.
Then hover with the mouse on the highest point and at the bottom of the preview render you can find the coordinates which correspond to the position.
The Y-value is the altitude. Note this value and enter that as value to replace "0" for near colour.

Choose z-depth instead of spherical.
Choose the new camera as distance camera.
Since the new camera faces upwards the distance shader will create a b&w gradient in the direction the camera is facing. Important!
The gradient is now black at 0 metres from the camera and white at x metres, where x means the altitude you measured in the preview render.

Now you've set up your distance shader and connect it in between the red and grey nodes (of the "parts shader").
Your model will now be vertically shaded.

Go to your original render camera and position it at 0, 1000, 0. For rotation enter -90, 0, 0.
The render camera now faces down at an altitude of 1000m.
Reset preview render and have it finished. The 1000m might be too much or not enough. Change accordingly.

Go to the lighting section and change the sun's elevation to 90 degrees.

Go to the render-tab and go to full render. Set render-size to a square formatted image, say 1000x1000 pixels.
Switch off "render atmosphere" and "render shadows".
Reset preview render and let it finish again.

You should now see a greyscale shaded version of your terrain.
Hit render and save the file as .bmp.
Crop the unwanted edges from your file in photoshop/GIMP/whatever (if applicable).
Save the file as .bmp.

Start a new project in TG2 and go to the terrain tab.
Choose "create heightfield -> heightfield load" and navigate to the .bmp file.
In the network you see 2 new nodes in the terrain group. A green one (heightfield load) which loads the .bmp and a red one (heightfield shader) which creates the heightfield.
Right click with mouse and choose "create heightfield operator -> heightfield resize" and link the new node in between the green and red node.
Double click on it and set the "resize to metres" value to your desired dimensions.

Now you should have a terrain inside TG2 which is capable of being displaced, textured and populated with grasses and trees. And water, and clouds :D

Ok, a long piece of text here, please let me know how it goes and report back here.
I did this all straight from my head so I might have missed some little things.

Cheers,
Martin

Talkietom

Wow!

Let me try this and get back to you - make take a while.

Many many thanks for this

PS it seems you can import height field data into SU

Tangled-Universe


Talkietom

We are still working on the Sketch Up model and haven't tried yet. I am doing the tutorials at the moment and having lots of fun. Will let you know when we get to this stage.

yvani

Hi,
reading this thread, I think a much easier way to achieve the export of terrain from sketchup to Terragen would be to directly produce heightmap image from sketchup. This is easily done with the fog function of sketchup. shortly described:

  • choose a top view of your terrain  (Camera/standard views/top)
  • set Camera to Paralelll projection (Camera/parallell projection)
  • set view to hidden line (View/Face style/Hidden line)
  • activate fog (in the default tray, fog menu )
  • manually ajust the fog start and stop distances, in such a way that the fog start at the higest point of your terrain and ends at the lowest. A more accurate way to do that is the use the plugin Fog Tool (https://extensions.sketchup.com/en/content/eneroth-fog-tool) , that enable the possibility to select start and end points of the fog
  • unselect default use background color in the fog dialog tab, and choose instead black color
  • if necessary unselect all lines displays (style dialog tab /Edit/unclick edges) and as well unselect axes display (View/axes)
  • --> you should get a greyscale display of your topography, that is usable as a heightmap for terragen once you've exported the view , cropped to terrain size (photoshop or other) .



bobbystahr

Both great solutions, wish I had SU...can this be done in the free version?
something borrowed,
something Blue.
Ring out the Old.
Bring in the New
Bobby Stahr, Paracosmologist