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 / matrix tilting

Author
Message
marc
21
Years of Service
User Offline
Joined: 5th Nov 2003
Location:
Posted: 23rd Nov 2003 03:21
Hi I would like to know...

What is the easiest way to tilt an object such way that it fits the matrix tile angle?

Thanks

M.-A. Mageau
Port-Cartier, Québec
Canada
waffle
22
Years of Service
User Offline
Joined: 9th Sep 2002
Location: Western USA
Posted: 26th Nov 2003 13:55
here's some code from my ski game just for that purpose
in my function call,

RPlayer# is an array of players and there x,y,z positions and
headings. _Cay,_X,_Z,_Y are constants used to reference those
values from the array
_TID,_RID are the actual object ID and the Rotation Object ID
P is the player number.
foot# is how far from the center of the object to test height
this function assumes you are using matrix 1 as your world

the trick here is to add a hidden object (_RID) and glue the main object (_TID) to it. Then, you use this function to apply pitch and roll to the _RID and use the _TID for possition data.

You will need to tinker with this to get it working for your needs and its not exactly optimized at this time. But, the math functions are right. You just need trial and error to get the TID and RID the right way and maybe change the RPlayer# array to something that makes sence to you.

internet gaming group
Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 27th Nov 2003 09:57
You could read the snippets board and see the code I posted just last week.
HoverFrog
21
Years of Service
User Offline
Joined: 7th Aug 2003
Location: Canada
Posted: 28th Nov 2003 21:22
Here I made that code to tilt a tank on a matrix, it basically reads point beyond, behind, left and right and the fonction returns the angle between the points. You have to call the fonction twice (1 for the tilt on the X axis and one for the Z axis.)
Tx#, Tz# and Tay# are the coordinate and y angle of the tank.
I then rotated the main body Limb of the tank.

Hope it helps, worked for me...

Login to post a reply

Server time is: 2024-11-25 18:40:39
Your offset time is: 2024-11-25 18:40:39