Quantcast
Channel: openFrameworks - Latest posts
Viewing all articles
Browse latest Browse all 40524

How to control the speed of a rotation

$
0
0

Is it actually getting faster and faster with time though, or just going really really fast?

It looks like you're multiplying the slider value by 1000 which would mean you're rotating by up to 1000 degrees or nearly three revolutions each frame, which is going to effectively result in it just bouncing around all different angles instead of any rotation effect.

Because the rotation speed is the amount you're changing the rotation each frame you'll want this to be a fairly small value ... e.g. say you're running at around 60fps, a rotation speed of 1 is going to mean it takes 360 / 60 = 6 seconds per rotation. So if you multiply your input control value by 18 you'd have a range from 0 - 3 rotations per second (or probably higher depending on your fps).

The value that you are writing to the log output is the amount it has rotated, and this should be always be increasing unless your input control is set to 0. It's the rotationSpeed value that shouldn't be changing for a steady rotation when the input value hasn't been changed.


Viewing all articles
Browse latest Browse all 40524

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>