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 / Slower spin for sphere

Author
Message
Nickydude
Retired Moderator
17
Years of Service
User Offline
Joined: 4th Nov 2006
Location: Look outside...
Posted: 17th Aug 2008 02:16
I have the following that spins a sphere:



How do I make the sphere spin slower?

TDK
Retired Moderator
21
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 17th Aug 2008 02:40


TDK_Man

Nickydude
Retired Moderator
17
Years of Service
User Offline
Joined: 4th Nov 2006
Location: Look outside...
Posted: 17th Aug 2008 12:51
Thanks TDK. I've just got DBP a few days ago and still trying to get my head around it, I've compiled your tutorials into a document ready to print out.

Could you possibly explain exactly what the 'yrotate' line does? I have a general idea from the help files but would like to know so I can study it and keep it for future reference.



Terrorist Zero
18
Years of Service
User Offline
Joined: 29th Aug 2006
Location: Teh YouKai
Posted: 17th Aug 2008 18:06 Edited at: 17th Aug 2008 18:07
The "yrotate object" function sets the desired object to a specific angle (e.g. "yrotate object 2,256" would set the angle of the object to 256 degrees).

Concentrating on the values inside the WrapValue() brackets we're finding out the current angle of the object on the Y axis and adding 0.1 to that value to give us the new angle the object is to be rotated to.

The WrapValue() function itself makes sure that the values inside the brackets don't add up to more than 360 (because it's just impractical to have an object have a rotational angle of more than 360), therefore once the value hits, lets say 361, then the WrapValue() function automatically returns it as a 1.
380 will return 20, 451 will return 91, and so forth...

Overall what the line is doing is telling object 2 to rotate on its Y axis to an angle 0.1 degrees greater than the previous time that line was called, but also to keep things simple by keeping the value between 0 and 360.

Hope that helped a little....

Nickydude
Retired Moderator
17
Years of Service
User Offline
Joined: 4th Nov 2006
Location: Look outside...
Posted: 17th Aug 2008 20:11
Certainly does, thanks!

Login to post a reply

Server time is: 2024-09-27 18:18:27
Your offset time is: 2024-09-27 18:18:27