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.

Dark Physics & Dark A.I. & Dark Dynamix / set object to camera orientation using rigid bodies

Author
Message
Omikron
20
Years of Service
User Offline
Joined: 12th Mar 2004
Location: UK
Posted: 11th Sep 2006 22:30
Forgive my dimwittedness, angles and rotations will forever be my downfall.

How do I set an object to the exact orientation of a camera, much as the set object to camera orientation command.

I've tried:

phy set rigid body rotation bullets(bullet_counter).objectid, camera angle x(), camera angle y(), camera angle z()

...but the angle seems a little off when the camera's at certain angles.

I'm sure there's a simple answer :/

Omikron
20
Years of Service
User Offline
Joined: 12th Mar 2004
Location: UK
Posted: 12th Sep 2006 22:02
~watches tumbleweed~

Alfred
17
Years of Service
User Offline
Joined: 22nd Jun 2006
Location: Jalisco, Mexico
Posted: 13th Sep 2006 03:57
I think that you are watching the offset produced by the diference of the positions betwen the camera and the bullets.

Hallowed are the ori.
Alfred
17
Years of Service
User Offline
Joined: 22nd Jun 2006
Location: Jalisco, Mexico
Posted: 13th Sep 2006 03:58
The code you are using would only work right when the bullets are straight in front of the camera. (The angles formed intersect the camera only in this position) So you need to set the bullets to an angle that is relative both to the position of the bullets and the position of the camera (NOT RELATIVE TO THE ANGLE OF THE CAMERA) since this way the angles are always perpendicular to the bullets and always intersect the camera.

Hallowed are the ori.
Alfred
17
Years of Service
User Offline
Joined: 22nd Jun 2006
Location: Jalisco, Mexico
Posted: 13th Sep 2006 03:59


You must find the angle using atanfull or a dummy object and then update acordingly.

Hallowed are the ori.
Alfred
17
Years of Service
User Offline
Joined: 22nd Jun 2006
Location: Jalisco, Mexico
Posted: 13th Sep 2006 04:00
Strange... I can only post 3 lines of text a time... server problem?

Anyway, I hope that helps.

Hallowed are the ori.
Omikron
20
Years of Service
User Offline
Joined: 12th Mar 2004
Location: UK
Posted: 14th Sep 2006 09:39
Seems a bit more logical. I'll give it a try later today and report back.

Thankyou for your response

Omikron
20
Years of Service
User Offline
Joined: 12th Mar 2004
Location: UK
Posted: 15th Sep 2006 01:49
Superb. Worked a treat

Resultantly I now understand the whole angle thing a fair amount more.

Thanks a million!

Login to post a reply

Server time is: 2024-04-19 11:47:39
Your offset time is: 2024-04-19 11:47:39