Hi guys, I am trying to write a script for creating random rotations based on current time (and previous frames). I want some objects to follow another objects rotation but with the flexibility of having the rotation performed at arbitrary frames. If that is not clear, the laymans term would be:
"rotate an object to the rotation of another scene objects rotation 10 frames ago"
I am using the sin function and float scripts for each object axis. Below is the code for the base object rotations followed by what I thought would be the right syntax.I have done a similar thing in MEL, so the basic principal is the same, I just need to know where I have gone wrong in Maxscript.
--base object rotation control
$.rotation.x_rotation.controller = Float_Script()
$.rotation.x_rotation.controller.script = "sin(5 * (degToRad currentTime * 100)"
$.rotation.y_rotation.controller = Float_Script()
$.rotation.y_rotation.controller.script = "sin(5 * (degToRad currentTime * 100)"
$.rotation.z_rotation.controller = Float_Script()
$.rotation.z_rotation.controller.script = "sin(5 * (degToRad currentTime * 100)"
--second objects rotation control
$.rotation.x_rotation.controller = Float_Script()
$.rotation.x_rotation.controller.script = "sin(5 *(degToRad (currentTime -10f) *100))"
$.rotation.y_rotation.controller = Float_Script()
$.rotation.y_rotation.controller.script = "sin(5 *(degToRad (currentTime -10f) *100))"
$.rotation.z_rotation.controller = Float_Script()
$.rotation.z_rotation.controller.script = "sin(5 *(degToRad (currentTime -10f) *100))"
--End of script
Thanks very much.
By AurasmaTD · 2012-10-19
Anubis · 2012-10-26