Aligning terrains and image maps

Started by Sethren, May 31, 2007, 01:25:09 AM

Previous topic - Next topic

Sethren

Speaking of heightfield operator issues.

What i am having troubles with is aligning the image map to match the exact size and rotation of the imported heightfields i am doing as of late. I thought there was a series of steps someone had posted here once concerning this dilemma but did i miss that?

In all honesty this is the one major thing that keeps me back from using TG2 regularly.

Lets say i have a color gradient that needs to be precisely aligned with the terrain matching elevation to color, how do i go about it? SOPack made this easy but i understand we are dealing with a planetary context now but still a means of local terrain editing should still be as easy as what i was doing in SOPack with my Nevada image.

http://www.ashundar.com/CPG/displayimage.php?pos=-3097


What i am having trouble with.





Oshyan

Yes, this has been discussed here before and there are solutions posted around in various places, but I'll cover it again here for clarity's sake. What you want to do is actually pretty simple as long as you know what the values you pointed out mean and you know the scale of your terrain.

You are correct that the position values are x, y, z where y is "up" (away from the planet at 0,0,0). You will want to set the position and position origin (center or lower left) the same as your heightfield. The key that you're probably missing is that the size is specified *in meters*, just as most measurements of size are in TG2. So provided you know the size of your terrain in meters it's easy to align things.

Unfortunately TG2 doesn't currently have a way to show you terrain size in meters or the height range, but it does respect those values as saved from other applications (provided the other application is using the .ter format correctly - World Machine currently does not, for example). So the best thing to do is check the terrain scale in your heightfield editor first. Then once you've imported the terrain and are setting up your image maps just enter in that same terrain scale and it should all come together. For example if your terrain is 16km square or 16,000 meters to a side, just enter 16,000 into both size fields (x and z). Remember the size is *not* measured in pixels, it's in meters, so you don't want to know the size of your heightfield in pixels (1024x1024), you want to know what it is in meters.

Hopefully that will solve your problem. Let me know if you have more questons.

Btw it makes things easier if you just attach the image in-line with the thread (using "Additional Options" at the bottom of the reply window).

- Oshyan

Sethren

Thank you for the quick response. It makes more sense now. Sorry, i posted in the wrong forum and for my image posting issue as i don't post here often enough as i'd like.

bigben

There are two quick ways to find out the size of your terrain.

1: Position lower left at 0,0 and zoom right in to the top right corner to see what the coordinates are.

2: Open the terrain in TG0.9 and click on Size in the terrain window. (The unregistered version will open larger terrains and show their size, it just doesn't render them at high resolution)

pagan

I amtrying to do the same thing and unfortunately did NOT succesed
I am using a highfield load of 702 meters sq, and 513x513 pixels.
I have entered 702 in the image size of the image map shader and it disappeared.
what I am trying to achive is to map some orthografic arial photographs...

bobbystahr

Quote from: pagan on August 29, 2008, 07:52:48 AM
I amtrying to do the same thing and unfortunately did NOT succesed
I am using a highfield load of 702 meters sq, and 513x513 pixels.
I have entered 702 in the image size of the image map shader and it disappeared.
what I am trying to achive is to map some orthografic arial photographs...

No matter what the pixel size[513x513 etc.] of the terrain you import I've found they all seem to come in at 10000 meters so what I do is I size my map to 10000 square[in TG5TP] if I want the map to cover the entire terrain...hope this helps.. ...
something borrowed,
something Blue.
Ring out the Old.
Bring in the New
Bobby Stahr, Paracosmologist

Oshyan

Terrains in .ter format will maintain proper scaling. Newly generated terrains do default to 10,000 meters but this can be adjusted.

Pagan, perhaps the problem is it's simply getting rather small and you're losing sight of it (700 meters is not that large when you're at a planetary scale as in TG2). The displacement amount may also need to be adjusted to correspond with the size (in meters) appropriately.

- Oshyan

monks

#7
I'm having a problem with this too. I've got a .ter saved from Wilbur at 8192 (came via Global Mapper -> World Machine). And an image map saved from PS as a bmp at 8192.
I've set the terrain size in Statisitcs, XY Size to 4000 Km. The image map is set identically to 4000 Km.
All terrain and image map shaders are set to pos centre. Image set to plan Y.
Yet the image image map is too large for the terrain.

I've set the terrain and image size back to the size reported in statistics and everything works.
Statisitcs is giving me 245730m, ie 30m per pixel- I don't have any idea where that figure came from. WM
is giving over 244m per pixel for the output.The terrain originated in Global Mapper and GM is outputting
at correct scales. I don't think WM is.

//just checked that and WM is outputting correctly.

When I change the size in stats and in the image map to another figure, they do not line-up.
Is it possible to change the size in stats?

monks


cyphyr

Making a change in the "Statistics" section has no effect, its there so you could copy and paste the size data in elsewhere say to an image map shader. To change the size of an imported terrain add a "Resize Terrain" node after the Heightfield load and heightfield nodes.
Hope this helps
:)
Richard
www.richardfraservfx.com
https://www.facebook.com/RichardFraserVFX/
/|\

Ryzen 9 5950X OC@4Ghz, 64Gb (TG4 benchmark 4:13)

monks

Ahhhh, never thought to look. Thanks Richard.

monks