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 / bearing question

Author
Message
Nul error
19
Years of Service
User Offline
Joined: 12th Aug 2005
Location:
Posted: 31st Aug 2005 22:23
Im trying to have a turret on a ship that would point at an object using a bearing system so that if the object is infront of the turret its 0 degrees and if to the back of the turret its 180. but using Bearing = atanfull(TargetX-MyX, MyY-TargetY) just gives me the angle between both objects regardless which way the turret is pointing.

just in case they its setup so the camera looks down on to the ship while the ship can rotate around

not sure posting the code would help since its supermessy now from trying to figure it out so ill add it if you guys need it.
The Cage Complex
19
Years of Service
User Offline
Joined: 26th Aug 2005
Location: Reims, France.
Posted: 2nd Sep 2005 18:53
If you want your turret pointing your ship you can simply use the set object to object orientation (current_turret, object_to_aim) command.

Then setting back angles of the turret you want to be fixed.

Nul error
19
Years of Service
User Offline
Joined: 12th Aug 2005
Location:
Posted: 4th Sep 2005 05:12
done that many probs using that. it makes the turrets to move using multiple axis instead of just one I need it and also I want to keep the turret to move around at its defined speed instead of instantly moving around if lets say a fast boat runs by it.
Silent Knight
19
Years of Service
User Offline
Joined: 25th Jan 2005
Location: In Your Mind
Posted: 7th Sep 2005 22:55
how about a yrotate object command? and then you work out some code to tell the degrees turned.

Version--DB Classic
900 mhz AMD Athlon, 128 MB RAM,
16 MB NVidia Vanta gfx card, Windows ME System software
spooky
22
Years of Service
User Offline
Joined: 30th Aug 2002
Location: United Kingdom
Posted: 8th Sep 2005 12:55
Here's an old snippet that 'may' help. Move around with cursors.



Boo!
Nul error
19
Years of Service
User Offline
Joined: 12th Aug 2005
Location:
Posted: 9th Sep 2005 01:06
silent yah I am in a way but mines on a z axis instead of y

this one points points to the target between angles so 0 degrees has to be absolute north. works fine but the turn toward function won't work for it.


the code Im working with seems to have an oscilating effect at its original position and the degree of movement to turn around slowly like both arguments are true on the function.


spooky thanks with that bit of code while I want the turret to automaticly turn towards the target like my old code it may help me figure out why im not getting the values like ang2#

Login to post a reply

Server time is: 2024-11-27 18:28:11
Your offset time is: 2024-11-27 18:28:11