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 / Help with code please.

Author
Message
Cyberflame
21
Years of Service
User Offline
Joined: 4th Sep 2003
Location: Im not sure....
Posted: 29th May 2004 00:45
I finally got my fireing code working, but i've run into a problem. My bullet fires from the center of my turret not the end of it. How do I make it so that I fire from the end of the turret.





IF your rolling along the ocean in you jet ski and the wheels fall off. Do you still have enough pancakes to cover a doghouse?

Purple, because icecream has no bones.
Lost in Thought
20
Years of Service
User Offline
Joined: 4th Feb 2004
Location: U.S.A. : Douglas, Georgia
Posted: 29th May 2004 02:53
? whats wrong with firing from the center? but if you wanted it to fire from the end a simple way would be to set the bullet to the same position and rotation of the turret (as you have obviously done) with the object hidden. move the object forward the distance to put it at the end of the gun. start firing code and show object. Hope this helps.

"People don't fail ..... they stop trying." Specs. P4 2.8GHz 800 FSB | 512MB DDR333
GeForce FX 5200 AGP 256MB | Windows XP Pro Full
Cyberflame
21
Years of Service
User Offline
Joined: 4th Sep 2003
Location: Im not sure....
Posted: 29th May 2004 03:07
THANK YOU!!! IT WORKS!!! W00t

IF your rolling along the ocean in you jet ski and the wheels fall off. Do you still have enough pancakes to cover a doghouse?

Purple, because icecream has no bones.
Lost in Thought
20
Years of Service
User Offline
Joined: 4th Feb 2004
Location: U.S.A. : Douglas, Georgia
Posted: 29th May 2004 03:08
Glad to hear it And Good luck.

"People don't fail ..... they stop trying." Specs. P4 2.8GHz 800 FSB | 512MB DDR333
GeForce FX 5200 AGP 256MB | Windows XP Pro Full
Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 29th May 2004 13:07
a# = turret rotation angle
r# = radius of first box(turret) + length of gun barrel

x = cos(a#)*r#
z = sin(a#)*r#

y = depends on height of turret object

"eureka" - Archimedes

Login to post a reply

Server time is: 2024-11-26 18:32:58
Your offset time is: 2024-11-26 18:32:58