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.

DarkBASIC Discussion / How to rotate the car acorrding to the matrix

Author
Message
DDD Productions
21
Years of Service
User Offline
Joined: 14th Mar 2004
Location: On Earth
Posted: 16th Apr 2004 23:42
How do you rotate a 3D object (in my case a car) acorrding to the height/steepness of a matrix.

D.D.D Productions
Specializing in game creation
zircher
22
Years of Service
User Offline
Joined: 27th Dec 2002
Location: Oklahoma
Posted: 17th Apr 2004 01:06
The most common method is to sample the slope of the matrix at several points around the car and determine the angle from that. You can use get ground height to do that. The tricky part is determining when a wheel is over a drop-off and not skewing the vehicle at some crazy angle.

Another method discussed is to replace the matrix with an object and then apply normal collision logic or use the Nuclear Glory Collision DLL.
--
TAZ

BatVink
Moderator
22
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 17th Apr 2004 01:25 Edited at: 17th Apr 2004 01:26
Quote: "Another method discussed is to replace the matrix with an object and then apply normal collision logic or use the Nuclear Glory Collision DLL"


As far as I can work out, you still need to sample the ground height. I use NG's RayIntersectObjectPRO(). You can actually do this with one Raycast if you're not too bothered for pinpoint accuracy, using RayHitNormPRO()

BatVink
http://facepaint.me.uk/catalog/default.php
AMD 3000+ Barton, 512K Ram, 120 Gig Drive space, GeForce 5200 FX 128 Mb, Asus A7N8X Mobo.
zircher
22
Years of Service
User Offline
Joined: 27th Dec 2002
Location: Oklahoma
Posted: 17th Apr 2004 06:22
I used the NGC.DLL for serveral vehicle tests (spheres hitting a polygonal .X level made of tiles) and was very happy with the results. I got some nice slope sliding effects, etc.
--
TAZ

BatVink
Moderator
22
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 17th Apr 2004 14:01
Zircher, did you get as far as multiple vehicles? I'm still experimenting with NG and multiple collision spheres on cars.

BatVink
http://facepaint.me.uk/catalog/default.php
AMD 3000+ Barton, 512K Ram, 120 Gig Drive space, GeForce 5200 FX 128 Mb, Asus A7N8X Mobo.
zircher
22
Years of Service
User Offline
Joined: 27th Dec 2002
Location: Oklahoma
Posted: 18th Apr 2004 00:04
Can't say that I did. I was helping out another forum member with game ideas for the alienware contest and we ran out of time. The project hasn't gone further than a single vehicle moving over a combination of object tiles and module-like levels with rolling hills.
--
TAZ

TEH_CODERER
21
Years of Service
User Offline
Joined: 12th Nov 2003
Location: Right behind you!
Posted: 18th Apr 2004 16:53
Look at the Tank Demo.

Current Projects: 'Level Editor 3D' and 'Animation Package v2.0'
[email protected]
DDD Productions
21
Years of Service
User Offline
Joined: 14th Mar 2004
Location: On Earth
Posted: 25th Apr 2004 22:46
Sorry it's taken a while to respond,
I had already calculated the ground height of the four corners of the car. I just need the formula required to calculate the x and z angles.

D.D.D Productions
Specializing in game creation

Login to post a reply

Server time is: 2025-05-23 11:25:57
Your offset time is: 2025-05-23 11:25:57