TerrainSceneNode inquiry ?

You are an experienced programmer and have a problem with the engine, shaders, or advanced effects? Here you'll get answers.
No questions about C++ programming or topics which are answered in the tutorials!
Post Reply
GueZt

TerrainSceneNode inquiry ?

Post by GueZt »

Hi All,

Assumming I can get the X and Z coordinate position from
the TerrainSceneNode HOW CAN I GET "Y" POSITION OUT OF IT?

I ask of this, because getCollisionPoint seems not working
on TerrainSceneNode.

Thanks for any hint.
zenoid
Posts: 40
Joined: Wed Jul 20, 2005 1:16 pm
Location: france
Contact:

Post by zenoid »

I'am doing this and it runs :
irr::video::IImage* heightMap = driver->createImageFromFile ("../art/heightmap.bmp");

heightmap is the 256*256 file that generate the terrain.

then a bit later after loading some objects from xml setup :

c = heightMap->getPixel((s32)XMLimportXpos,(s32)XMLimportYpos);
float height = c.b;
node->setPosition(core::vector3df(XMLimportXpos*400 ,
height*10000, XMLimportYpos*400));
the 400 and 1000 are related to the scale of the map.
that should work.
GueZt

Post by GueZt »

I will try that one, thanks.
Post Reply