Difference between revisions of "Musicboxes"
From CCRMA Wiki
m |
m |
||
Line 6: | Line 6: | ||
calculate n-times rotation / min. of various diameters | calculate n-times rotation / min. of various diameters | ||
+ | |||
+ | public class SpinningBox : MonoBehaviour { | ||
+ | |||
+ | public float yawDegreesPerSecond = 10.0f; | ||
+ | |||
+ | // Update is called once per frame | ||
+ | void Update () { | ||
+ | Vector3 localEulers = transform.localEulerAngles; | ||
+ | localEulers.y += yawDegreesPerSecond * Time.deltaTime; | ||
+ | transform.localEulerAngles = localEulers; | ||
+ | } |
Revision as of 19:08, 25 August 2014
rotating cylinders a la astrolabes
spherical astrolabe
calculate n-times rotation / min. of various diameters
public class SpinningBox : MonoBehaviour { public float yawDegreesPerSecond = 10.0f; // Update is called once per frame void Update () { Vector3 localEulers = transform.localEulerAngles; localEulers.y += yawDegreesPerSecond * Time.deltaTime; transform.localEulerAngles = localEulers; }