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.

Author
Message
davidt
23
Years of Service
User Offline
Joined: 29th Apr 2003
Location: United Kingdom
Posted: 25th May 2003 19:53
Does anyone know how I would align an object with a matrix, like the tank did in the old tank demo for DarkBASIC. I want it so that the model will not always be flat on the ground, and rotates slightly so that it looks like it follows the terrain. For example, when a car goes up a hill, it is not flat, but is aligned with the hill.

I don't have the source code for the tank demo, and seem to remember not understanding it ( ). If anyone has a function or some source code on how it is done, and can explain it, it would be really helpful.

Thanks, David
Spec - Abit NF7-S nForce 2, AMD Athlon 2100+, 256Mb PC2700, ATI Radeon 9000Pro, 20Gb Seagate U6, DVD-ROM, Zip 100, 15" TFT monitor
Firesea
23
Years of Service
User Offline
Joined: 7th Apr 2003
Location:
Posted: 25th May 2003 23:11
I remember someone suggesting the hovercraft example, game somewhere on this sight - seems it tilted the crafts based on the matrix inclination.
ozak
23
Years of Service
User Offline
Joined: 22nd May 2003
Location: Denmark
Posted: 26th May 2003 12:01
I haven't tried this in DBPro, but normally you would fire out four rays (this could be height map checks in the matrix case) and then rotate your craft based on the angle between these. You'd get for rotation matrices then which you would combine to produce the final result.

Regards

Ozak

Login to post a reply

Server time is: 2026-07-11 19:06:15
Your offset time is: 2026-07-11 19:06:15