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 / Rotate that sphere!

Author
Message
QuothTheRaven
17
Years of Service
User Offline
Joined: 2nd Oct 2002
Location: United States
Posted: 24th Oct 2002 05:10
I have my big ol' bullet, a sphere,10 thats scaled 100,100,800000 to make a nice long bullet shaped object for semi-instant collision. Now, what code do I need to get the long end sticking out of the camera? I can't rotate it quite right, it always comes out funny. So my little guy would look like this:
guy bullet
O
and wherever he looked, the bullet stayed on that oreintation to the screen?
QuothTheRaven
17
Years of Service
User Offline
Joined: 2nd Oct 2002
Location: United States
Posted: 24th Oct 2002 23:29
the little drawing I made didn't work, ignore it. Any solutions?
The Darthster
17
Years of Service
User Offline
Joined: 25th Sep 2002
Location: United Kingdom
Posted: 25th Oct 2002 02:00
You'll need to yrotate your bullet the same amount as your camera rotation, and then xrotate it as well (if you have free looking on). This probably won't work with the dodgy rotation commands. You could always try rotating the bullet to zero, and then turning it right and pitching it up or whatever. You'll also have to move the sphere so it isn't sticking out the back as well.

Um...


That's almost certainly not right, I just made it up and haven't tested it (due to the trial version running out). Surely if you have a bullet collision that big, you'll be able to shoot multiple enemies and through walls.
QuothTheRaven
17
Years of Service
User Offline
Joined: 2nd Oct 2002
Location: United States
Posted: 26th Oct 2002 03:09
Well since that sadly does not work, can anyone else help me?
indi
17
Years of Service
User Offline
Joined: 26th Aug 2002
Location: Earth, Brisbane, Australia
Posted: 26th Oct 2002 05:41
tryin adding the correct media number to make it turn.

bullet = bullet number


yrotate object bullet, camera angle y()
xrotate object bullet, camera angle x()

position object bullet x#+(sin(camera angle y())*sin(camera angle x())*400000),y#+(cos(camera angle x())*400000),z#+(cos(camera angle y())*sin(camera angle x())*400000)

http://www.lunarpixel.com/ is my new site

Login to post a reply

Server time is: 2020-08-13 18:01:57
Your offset time is: 2020-08-13 18:01:57