Image overlay not lining up with Heightfield import

Started by Sethren, January 05, 2007, 09:49:57 PM

Previous topic - Next topic

Sethren

I created a heightfield in world machine, saved it as a .ter then i made a color map overlay to match the slope of the heightfield. So they are both perfectly lined up to one another then when i import them into terragen 2 the image map is either 45 degrees turned or the wrong size so trying to fix it for the last 2 hours and nothing worked. I thought of slightly rotating the image map but it will not rotate at all.





The dark parts of the terrain are supposed to line up with the higher elevation only.

Sethren

Um, hello. Is my inquiry making any sense?      ;D

calyxa


Sethren

Through camera and i did try ever other projection type and nothing changed.

calyxa

through camera will not work unless your camera is directly overhead projecting down....

I've gotten it to work, sort of -- "Plan Y" is the projection to use.  the part I'm having a really hard time understanding is the scaling.

the location for the heightfield .ter and for the bitmap need to be the same.  I was thinking the sizes would need to be the same as well, but I had to tell the bitmap to be some 6 times larger than the .ter heightfield for it to work even close to correctly.


Sethren

I have used Plan Y and the bitmap does not change.    :-\

I have even trouble shot the locations for the .ter and the bitmap but it never matches up.

The .ter is 2048 by 2048 and the bitmap is as well 2048 by 2048 yet the bitmap is still facing a few degrees clockwise.    :-\


calyxa

dunno what to tell you, then.  as you can see from my screenshot, I lined mine up OK.

"through camera" for sure is wrong, though.

the only way I might be able to help any further is if you were to pack up your .tgd, .ter and bitmap into a zip file for me and I'd look at it here.  to tell you the truth, though, I hadn't even looked at lining up a bitmap texture to a .ter terrain until I set up my test in response to your query, betting that the simple "plan y" and scaling thing would solve it.

Sethren

I think i fixed it. I had to increase the scale to 10000 were originally i had it at 1 so it fits now.    :D

Oshyan

PlanY Projection should be used for this, as previously understood. The scaling is measured in *meters*, not pixels, so you have to know the size in meters of your heightfield. You should be able to get this information from your terrain modeling program, and it will also be more easily available in TG2 in the future. Once you know your terrain size in meters just set your image to the same size, make sure its position (and origination point) are the same as the heightfield, and it should line up perfectly. Keep in mind that by default heightfields have a falloff at the edges which may make your texture look wrong at the edges. You can reduce the falloff to 0 in the Heightfield Shader if you don't want it.

- Oshyan