Page 1 of 1

place model in terrain at specific location

Posted: Mon Aug 21, 2006 2:53 am
by sunnygraphy
Hi..

I am having difficulty in placing my models in Terrain at a predefined locations.

When I use 3ds or .x for scene, I do not have to worry about placing.

But in Terrain, I do not know how to place models there.

Any Comment is big help..


thanks

Posted: Mon Aug 21, 2006 6:37 am
by Elfloard2
For your models, if your using Animated Mesh Scene nodes, then you could do something close to this

IAnimatedMeshSceneNode*Model=smgr->addMeshSceneNode("Fill in Parameters")

then to set the position you would do
Model->setPosition(vector3df("Fill in X,Y,Z chords")


Don’t copy the code i posted, its just a reference.

If I did not answer your question exactly, then please restate the problem because you were not too clear.

Posted: Mon Aug 21, 2006 7:41 am
by sunnygraphy
Hi..

My question was not that one.

When I created my scene using 3ds, I could put all my models on the scene from Max programng.

But When I create scene using CTerrainSceneNode, I was just loading pixels(512 X 512).

So I could not place models at the place I want.


Thanks

Posted: Mon Aug 21, 2006 9:55 am
by hybrid
That's because a TerrainSceneNode just creates the surface to walk on or fly by, not a complete scene with entities and such. Scene loading is available for .irr and collada files, and with an extension also with anim8or files. Otherwise you have to place objects manually/with your own file format.

Posted: Mon Aug 21, 2006 12:16 pm
by sunnygraphy
hybrid wrote:That's because a TerrainSceneNode just creates the surface to walk on or fly by, not a complete scene with entities and such. Scene loading is available for .ii and collada files, and with an extension also with anim8or files. Otherwise you have to place objects manually/with your own file format.


I will save terrain as wrl format then load it from Max and place my model on it . Then load my models in irrlicht.


Thanks

Posted: Mon Aug 21, 2006 12:44 pm
by hybrid
Yes, that's possible with .irr and Collada files. Otherwise (e.g. with .3ds) you won't get different meshes, but the complete scene is one large object. Probably not what you want.

Posted: Mon Aug 21, 2006 1:23 pm
by Spintz
Or you could look into FreeWorld3D or PnP Terrain Creator.

Posted: Mon Aug 21, 2006 3:56 pm
by Spintz
Also, I've made a post for a quicker method to get the height on the terrain at a given x and z position.

http://irrlicht.sourceforge.net/phpBB2/ ... hp?t=14874

Posted: Tue Aug 22, 2006 9:30 am
by sunnygraphy
Spintz wrote:Also, I've made a post for a quicker method to get the height on the terrain at a given x and z position.

http://irrlicht.sourceforge.net/phpBB2/ ... hp?t=14874

I finally added code for exporting terrain to VRML(wrl) format.
So now I could place my models on the terrain.


thanks