-
-
Notifications
You must be signed in to change notification settings - Fork 35.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
misc_animation_keys example update #11304
Conversation
examples/misc_animation_keys.html
Outdated
|
||
var tracks = []; | ||
// POSITION | ||
var positionKF = new THREE.VectorKeyframeTrack('.position', [0, 1, 2], [0, 0, 0, 30, 0, 0, 0, 0, 0]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Formatting does not seem to be consistent...
examples/misc_animation_keys.html
Outdated
var clip = new THREE.AnimationClip( 'Action', -1, tracks ); | ||
var qInitial = new THREE.Quaternion().setFromAxisAngle( xAxis, 0 ); | ||
var qFinal = new THREE.Quaternion().setFromAxisAngle( xAxis, Math.PI ); | ||
var quaternionKF = new THREE.QuaternionKeyframeTrack('.quaternion', [0, 1, 2], [qInitial.x, qInitial.y, qInitial.z, qInitial.w, qFinal.x, qFinal.y, qFinal.z, qFinal.w, qInitial.x, qInitial.y, qInitial.z, qInitial.w ]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some whitespaces are missing at various places: Instead of [0, 1, 2]
-> [ 0, 1, 2 ]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems like I turned on some option that does that automatically when I save the file somehow 🙁
@looeee 👍, but wouldn't it perhaps be nice to switch the single animations on/off via buttons? |
Would do this in a separate example. |
I would keep it simple. @looeee's implementation is fine. |
Thanks! |
VectorKeyframeTrack
for.position
and.scale
.QuaternionKeyframeTrack
, rotating about x axis ( and switched to sphere to box so that rotation is visible).It occurred to me that this example should be renamed to misc / animation / basic_use as that is what it's really showing. Then it could also be expanded a little more to show how
AnimationObjectGroup
works, and maybe a couple of other simple things.