How can i make a SceneNode moves above a Terrain!

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
mmh771
Posts: 39
Joined: Thu Apr 27, 2006 7:02 am

How can i make a SceneNode moves above a Terrain!

Post 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! ....
mR.haHN
Posts: 49
Joined: Wed May 03, 2006 5:37 pm

Post by mR.haHN »

I think what you need is the NEWTON physics engine - programming vehicle physics by yourself will be VERY hard....
mmh771
Posts: 39
Joined: Thu Apr 27, 2006 7:02 am

Post by mmh771 »

Am not talking about a pyhsics here ... i just want to know how to move a box over a terrain ....
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post 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:
moonshine721
Posts: 9
Joined: Sun May 07, 2006 2:22 am
Location: Dlut.Dalian.China

Thats easy

Post 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".
HI.I'm Chrisalane.Nice to meet many crazy game developer here.
mmh771
Posts: 39
Joined: Thu Apr 27, 2006 7:02 am

Post 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 )
mR.haHN
Posts: 49
Joined: Wed May 03, 2006 5:37 pm

Post 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.
Post Reply