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 Rotating Sphere Around Global Axis

Author
Message
Phantom 2590
17
Years of Service
User Offline
Joined: 19th Apr 2007
Location: Earth...
Posted: 9th Jan 2008 04:54
ok,. so, basically what i have is a cube which rotates when i get to one side of the cube, and i have a little "apple" piece that appears randomly and wen u go over it with your player the piece is deleted and you get a point, the problem I'm having is i want the piece to rotate around the global x and z axis whenever the cube rotates, basically so that if the piece appears randomly on the bottom of the cube i can successfully rotate everything by moving so that the piece is on top and i can "eat" it.
Here's the code I got so far. Basically everything works the way I want except for the rotating of the piece thing.


Phantom 2590
17
Years of Service
User Offline
Joined: 19th Apr 2007
Location: Earth...
Posted: 12th Jan 2008 23:39
*bump*

Sven B
19
Years of Service
User Offline
Joined: 5th Jan 2005
Location: Belgium
Posted: 13th Jan 2008 09:50
Attached is LowerLogics rotation functions. The functions may be too much, but the ones you're searching are

Rotate_GX(obj, amount#)
Rotate_GY(obj, amount#)
Rotate_GZ(obj, amount#)

It's the programmer's life:
Have a problem, solve the problem, and have a new problem to solve.

Attachments

Login to view attachments
Phantom 2590
17
Years of Service
User Offline
Joined: 19th Apr 2007
Location: Earth...
Posted: 13th Jan 2008 18:53
thx ive tried that
didnt work
i suppose i could try again wouldnt hurt

Sven B
19
Years of Service
User Offline
Joined: 5th Jan 2005
Location: Belgium
Posted: 14th Jan 2008 18:50 Edited at: 14th Jan 2008 18:50
the angles you have to input aren't full angles, just increase values.
eg. Rotate_GX(1, 15) will just rotate object 1 its current angle + 15 degrees around the X axis.

This means that calling Rotate_GX(1, 1) 360 times will just rotate the object 360 degrees in steps of 1 around the global x axis.
I use the functions myself, and they've never failed me ^^.

It's the programmer's life:
Have a problem, solve the problem, and have a new problem to solve.
Phantom 2590
17
Years of Service
User Offline
Joined: 19th Apr 2007
Location: Earth...
Posted: 14th Jan 2008 23:23
here's what i had previously with Rotate_GX and Rotate_GZ functions


Login to post a reply

Server time is: 2024-09-27 10:37:28
Your offset time is: 2024-09-27 10:37:28