Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / Getting Terrain Incline

Author
Message
Bartman
20
Years of Service
User Offline
Joined: 15th Sep 2004
Location:
Posted: 15th Sep 2004 13:09
Hello, I have started a small tank warfare game. It involves players driving their tanks around a large battlefield with hills and valleys. What I need to do, is angle the player object to reflect when they are sitting on a slope, so that it appears the object is resting on the hill and not sticking out of it.

I am using the NuclearGlory collision system, and a .x model for the terrain and the tanks.

If anyone has any ideas, I would really appreciate them.

Thanks,

Mike Bartman
http://www.darkomenstudios.com
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 15th Sep 2004 17:57
NG Ray Cast on each corner of the vehicle, to get the terrain height.

Or...stick a NG collision sphere on each corner, then it will move with the terrain. You will still need to calculate the differences in height and thus the angle of the dangle.

If you just want up/down movement, and not sideways tilting, you can do it with just 2 points.

BatVink
http://biglaugh.co.uk/catalog AMD 3000+ Barton, 512Mb Ram, 120 Gig Drive space, GeForce 5200 FX 128 Mb, Asus A7N8X Mobo.
Terms & Conditions apply
Bartman
20
Years of Service
User Offline
Joined: 15th Sep 2004
Location:
Posted: 16th Sep 2004 06:41
Thanks, I figured that out a while after I posted and I felt stupid. I didn't realize that there was a function in NG to get the collision distance, and then I looked at the hovercraft game tutorial and put something together.

Thanks,

Mike Bartman
http://www.darkomenstudios.com
bibz1st
21
Years of Service
User Offline
Joined: 2nd Jan 2003
Location:
Posted: 19th Sep 2004 20:59
would you mind sharing how you acheived it with a little working snippet?
Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 20th Sep 2004 02:50
This what you want?



"eureka" - Archimedes

Login to post a reply

Server time is: 2024-09-23 00:26:15
Your offset time is: 2024-09-23 00:26:15