Hello everyone !
I want to manipulate the rotation of a 3d object (using threejs).
So in order to do that, I'm able to use:
gsap.to(myObject.rotation, {
duration: 1,
x: "random(0,30)"
});
The issue is that the rotation property of threejs object is in radians. So I need to convert it to degrees. I can use the util method from threejs:
THREE.Math.degToRad(myValue)
but it needs a number, not a string.
So I would like to know if there is a way to "compile" the random value in string format to a number ?
Of course I can make a parser to convert the string to the appropriate value. But I just wanted to know if there was a more vanilla way to do it?
Thanks !