PDA

View Full Version : How to get around the FPS speed limit?


Scott Ayers
06-09-2010, 08:58 PM
Is there a method for getting around the FPS wall you hit when rotating objects?

Here's a simple example of rotating an object.
Once the value reaches 1 (or 100% if Radians are used). The rotation value can't be increased anymore unless the FPS are also increased as well.
Does anyone know a way to get around this problem?

var speed = 1; // Going past 1 doesn't increase speed anymore
main(doc,op)
{
var rot = op->GetRotation();
var amount = rot.z + speed;// How much it moves per cycle
op->SetRotation(vector(0,0,0 + amount)); //Apply the calculated rotation

}

-ScottA

Cairyn
06-10-2010, 08:45 AM
Here's a simple example of rotating an object.
Once the value reaches 1 (or 100% if Radians are used). The rotation value can't be increased anymore unless the FPS are also increased as well.
Does anyone know a way to get around this problem?


Sorry, I don't see a problem on my system.

If I use your script as a COFFEE tag on a simple cube, I get a change of 57.296 ° per cycle with speed=1. When I set speed=7, I get 401.07 °, which is 7 times 57.296... and what does this have to do with frames per second at all?

tcastudios
06-10-2010, 04:04 PM
You are witnessing the "wagon wheel" effect.
As, when the cube rotate 90 degrees per frame(or any mult of that),
it visually stands still.

Cheers
Lennart

Scott Ayers
06-10-2010, 04:08 PM
Keep increasing the value and watch your object(not the values). Eventually it will stop speeding up and then it will start slowing down.
Once the value gets large enough. Even though the amount value of rotation increases, the rotation of the object ends up topping out then starts to slow down.
Increasing FPS was a way I was using to cheat this. Sort of like increasing the CPU cycles in a game engine. But it's not a usable fix.

There is a limited range of how much rotation you can squeeze into your FPS until it tops out and then doubles back on itself when you look at the object in the scene.
It's a sine curve. But the top of the curve isn't anywhere near as fast as I need it to be in order to create the effect I'm looking for.

What I'm looking for is a way to create a very, very fast rotating object like an airplane propeller.
Not the full speed where it looks like a blur(that has to be faked). But the transition where it goes from rotating very fast to a blur.
Using vector rotation values for that seems to have a built in speed limit that doesn't even get you close to that kind of speed. So I was wondering if anyone had any tricks on dealing with that?

-ScottA

Cairyn
06-10-2010, 04:25 PM
Keep increasing the value and watch your object(not the values). Eventually it will stop speeding up and then it will start slowing down.
Once the value gets large enough. Even though the amount value of rotation increases, the rotation of the object ends up topping out then starts to slow down.
Increasing FPS was a way I was using to cheat this. Sort of like increasing the CPU cycles in a game engine. But it's not a usable fix.

Perhaps you posted the wrong script then? Technically, "speed" is just a constant speed (change of position - or in this script, rotation - per time unit). It's not acceleration - if you want to accelerate, you would have to increase "speed" in each step. That doesn't happen.

I have set "speed" to 7 and observed the rotation up to well over a million degrees in the editor. The rotational speed is constant. There is no slowdown.

Since you're speaking of acceleration, I added two lines to your code:


var speed = 1; // Going past 1 doesn't increase speed anymore
main(doc,op)
{
var rot = op->GetRotation();
var amount = rot.z + speed;// How much it moves per cycle
op->SetRotation(vector(0,0,0 + amount)); //Apply the calculated rotation
speed = speed + 0.1;
println(speed);
}


By changing "speed", I can see what you might observe, the speed seems to oscillate. But of course that is an optical effect:
http://en.wikipedia.org/wiki/Wagon-wheel_effect

You can only observe rotational speeds between 0 and 180 degrees. Speeds between 180 and 360 degrees look like turning backward (well, depends on the symmetry of the object actually). And everything above is just cyclically (modulo 360) the same because if the object rotates n*360 degrees during a frame, it looks as if it doesn't move at all.

tcastudios
06-10-2010, 04:29 PM
One way to do it is to mix the visibility between the geometry
(propeller blades i.e.) and a circular gradient disc.

Rotor example 4mb QT (http://homepage.mac.com/tcastudios/tempfiles/SteadyROTORtestS.mov)

Cheers
Lennart

Cairyn
06-10-2010, 04:43 PM
One way to do it is to mix the visibility between the geometry
(propeller blades i.e.) and a circular gradient disc.


Hey, that is a cool trick!

Scott Ayers
06-10-2010, 05:59 PM
Yeah. That's what I was planning on doing Lennart.
I was just wondering if I could get more speed from my rotations before switching to that kind of thing.

I was practicing making custom methods. And I set up a scene where the propeller speed was controlled by the angle of the plane(faster when climbing).
I couldn't get the prop to spin fast enough to look right while in cruise mode before the plane went into climb mode using that kind of trick. So I was wondering if maybe I was missing something.

I guess what I'll have to do is start out with a blend method from the start. And then change the amount of blend with the script. Rather than trying to do it with rotations.

-ScottA

Srek
06-11-2010, 07:24 AM
What you are looking for is motion blur. The resonance/wagonwheel effect can't realy be resolved by anything else. I have seen some clever solutions with trails and trailin gobjects of increasing opacity, but they all produce far worse results than SMB
Cheers
Björn

Scott Ayers
06-11-2010, 06:00 PM
Thanks srek,

I was hoping to do this without using any rendering tricks.
But using Vector MB does look like another good way to fake that blurred high speed rotation look.

-ScottA

CGTalk Moderation
06-11-2010, 06:00 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.