Page 1 of 1

How can i make a SceneNode moves above a Terrain!

Posted: Sat May 06, 2006 7:28 pm
by mmh771
I've created a terrain object and a car object using 3dMax, and converted them into my3d, and load them separately in Irrlicht Scene.

The car named: carNode, and the terrain named: terrainNode, and also created a FPS camera in Irrlicht named: cameraNode.

Now the cameraNode collide with both terrianNode and CarNode, and i've also created a collision response animator between the car and the terrain.

But what i need now is "HOW to make the car moves ABOVE the terrain?!" ... the path is not critical here .. i just want it to move above it just like in real world, when it face a hill; it will go up, when i face a slope; it will go down.

Any help please! ....

Posted: Sat May 06, 2006 7:34 pm
by mR.haHN
I think what you need is the NEWTON physics engine - programming vehicle physics by yourself will be VERY hard....

Posted: Sat May 06, 2006 8:55 pm
by mmh771
Am not talking about a pyhsics here ... i just want to know how to move a box over a terrain ....

Posted: Sat May 06, 2006 9:53 pm
by hybrid
You just use the collision response when the car collides with the terrain it moves the car up. Check out the terrain example which is part of Irrlicht :idea:

Thats easy

Posted: Sun May 07, 2006 2:29 am
by moonshine721
For simple use,U can just get the vertical position "iGroundPos" of the Terrian at every beginning of a frame,&keep a certain distance from "iGroundPos".

Posted: Sun May 07, 2006 7:23 am
by mmh771
MoonShine721,
Will i still be able to use the "iGroundPos" even if i am not using an Irrlicht Terrain! .... as i said above the terrain i am using is actually my3d object ... built with 3Dmax ....

and would you PLEASE post some code just to explian the use of that function (iGroundPos )

Posted: Sun May 07, 2006 7:25 am
by mR.haHN
Ah, I thought you want the car to lean back when it goes up a hill and so on... If you just want the car to move above the terrain, just use the collisionResponseAnimator.

EDIT: I think the ResponseAnimator is a lot easier than dealing with the ground pos and so on - especially if your terrain is a model.