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 / detecting if object is facing a point in 3d space or not

Author
Message
phukol
21
Years of Service
User Offline
Joined: 22nd Nov 2003
Location:
Posted: 27th Apr 2004 21:13
hi guys! just wana ask if how could i make my 3d object detect if it is facing a specified point or not. Samples or ideas would mean a lot. THX!

phukol
sponge008
21
Years of Service
User Offline
Joined: 8th Feb 2004
Location: MA, USA
Posted: 28th Apr 2004 01:51
The only way I could think of doing this is checking for the angle of the object...then using trigonometry.
phukol
21
Years of Service
User Offline
Joined: 22nd Nov 2003
Location:
Posted: 28th Apr 2004 06:27
Yes. i could check for the angle between the object and the point by using atanfull(object x position - point x position,object z position - point z position). but i dont know what angles should be the result in order to know if i'm facing a point or not.

phukol
bibz1st
22
Years of Service
User Offline
Joined: 2nd Jan 2003
Location:
Posted: 1st May 2004 15:27
you could use a dummy object, hide it and position it at the main objects position
POINT OBJECT dummy,x#,y#,z#
then just check if all 3 angles from both objects are the same
rob
phukol
21
Years of Service
User Offline
Joined: 22nd Nov 2003
Location:
Posted: 1st May 2004 23:51
thx dude

phukol

Login to post a reply

Server time is: 2025-05-23 14:38:22
Your offset time is: 2025-05-23 14:38:22