Recently, I've been experimenting with three.js and tween.js and I'm curious if it's possible to animate a variable using tweening?
Here are some of my attempts:
1)
tween = new TWEEN.Tween(renderergl.toneMappingExposure).to( "0.001", 1000 ).easing(TWEEN.Easing.Exponential.InOut).onComplete(function() {
// Completed
}).start();
tween = new TWEEN.Tween(renderergl.toneMappingExposure).to( 0.001, 1000 ).easing(TWEEN.Easing.Exponential.InOut).onComplete(function() {
// Completed
}).start();
var toneMap = renderergl.toneMappingExposure;
tween = new TWEEN.Tween(toneMap).to( "0.001", 1000 ).easing(TWEEN.Easing.Exponential.InOut).onComplete(function() { }).start();
Both result in:
Object prototype may only be an Object or null: 0.001
I'm uncertain if variables can indeed be animated. Could someone provide clarification on this matter?