# 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!

Message
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?
Posted: 24th Oct 2002 23:29
the little drawing I made didn't work, ignore it. Any solutions?
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.
Posted: 26th Oct 2002 03:09
Well since that sadly does not work, can anyone else help me?
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