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 / X,Z positions from y angle

Author
Message
Murzo
21
Years of Service
User Offline
Joined: 9th Mar 2003
Location:
Posted: 16th Mar 2004 01:31
is there anyway to calulate an objects x and z positions from its y angle? Any help is much appreciated
Trowbee
21
Years of Service
User Offline
Joined: 12th Apr 2003
Location: United Kingdom
Posted: 16th Mar 2004 03:28
If I'm reading this right, then no.
An objects position and angle are 2 different things.

However, if you mean where it will be, based on y angle (trig), then look for the newyvalue command.
NB: newxvalue, newyvalue and newzvalue all do the same thing, the naming is different for ease of use.
walaber
20
Years of Service
User Offline
Joined: 22nd Oct 2003
Location: Los Angeles, CA
Posted: 16th Mar 2004 09:25
assuming x#,y#,z# are your base positions, and yangle# is your angle, and d# is the distance from x#,y#,z# that you want to place the object, you can do this:

x2# = x# + (cos(yangle#) * d#)
y2# = y#
z2# = z# + (sin(yangle#) * d#)

then position your object at x2#,y2#,z2#.

that should do it.

p.s. newxvalue/newyvalue/newzvalue basically do the above, based on different axes.

Go Go Gadget DBPRO!

Athlon XP 2400+ || DDR-SDRAM 1GB || Nvidia GeForce 4 Ti4200 AGP 8x 128MB

Login to post a reply

Server time is: 2024-09-22 02:47:27
Your offset time is: 2024-09-22 02:47:27