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 Professional Discussion / Any way to calculate this??

Author
Message
Bulleyes
21
Years of Service
User Offline
Joined: 3rd Nov 2002
Location: Cyberjaya, Malaysia
Posted: 27th Dec 2002 12:28
Hi,

I had an object which had its local +Z axis as pointing FRONT. The object can be rotated respect to its local X, Y and Z axis, as it is an aeroplane.

How do I calculate the coordinate 40 units from the object position to where it is currently pointing, i.e. where its local +Z axis is pointing now.

I heard this can be done using NewXvalue(), NewYvalue(), and NewZvalue() command? How can I do that?

Thanks!
Bad Nose Entertainment - Where games are forged from the flames of talent and passion.

http://www.badnose.com/
xtom
21
Years of Service
User Offline
Joined: 26th Aug 2002
Location: Ireland
Posted: 27th Dec 2002 23:23
Maybe something like this, where the object number is 1, I'm not sure if I've got the angles arranged correctly, you'll have to test it out.

xpoint=newxvalue(object position x(1),object angle x(1),40)
ypoint=newyvalue(object position y(1),object angle y(1),40)
zpoint=newzvalue(object position z(1),object angle z(1),40)

If it's just a 2d coordinate your looking for you'll only need 2 of the above. Usually x and z if your looking down on it.

Login to post a reply

Server time is: 2024-05-17 04:36:44
Your offset time is: 2024-05-17 04:36:44