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 / Spherical (Object) Rotation?

Author
Message
Kyle Katarn
17
Years of Service
User Offline
Joined: 7th Jun 2007
Location: Central Coast, Australia
Posted: 11th Jul 2007 14:03 Edited at: 11th Jul 2007 14:07
Okay I have a small problem. In the intro to my game, I want to have a slow zoom in on a slightly rotating planet. What sort of commands will I need to use to make it continuoulsly spin?

I have a small piece of coding that doesnt work, but I'd like to get some verification if I'm on the right track?

RUCCUS
19
Years of Service
User Offline
Joined: 11th Dec 2004
Location: Canada
Posted: 11th Jul 2007 14:52 Edited at: 11th Jul 2007 14:55
Remove the for loop, leaving the rotation commands inside the main loop. Change the rotation value to OBJECT ANGLE X(1) + 1 for the x rotation, and OBJECT ANGLE Y(1) + 1 for the y. This will rotate the object 1 degree on the x and y each loop.

You might want to look up for loops again, it seems you have the wrong idea with step values there. If you want x to increase by 0.05 each loop in a for loop, put STEP 0.05 at the end of the FOR line. You'll also need to declare x as a float (x#) instead of integer, and have it's starting value a float by adding a .0 to the end (in this case, 0.0).

But that doesnt matter right now since you dont need a for loop for this problem.

Also, if you want the camera to slowly come to a stop, Id recommend using curvevalue. Eg;

POSITION CAMERA CAMERA POSITION X(), CAMERA POSITION Y(), CURVEVALUE(CAMERA POSITION X(), 0, 100)

Look it up for more info.


Kyle Katarn
17
Years of Service
User Offline
Joined: 7th Jun 2007
Location: Central Coast, Australia
Posted: 11th Jul 2007 16:33
Ah once again he's helped me out of a stir, thanks heaps man.

Login to post a reply

Server time is: 2024-11-25 15:23:43
Your offset time is: 2024-11-25 15:23:43