Skip to content
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

Merged
merged 3 commits into from
May 14, 2017

Conversation

looeee
Copy link
Collaborator

@looeee looeee commented May 9, 2017

  • Changed the keyframe type to VectorKeyframeTrack for .position and .scale.
  • Added a QuaternionKeyframeTrack, rotating about x axis ( and switched to sphere to box so that rotation is visible).
  • Added some comments.

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.

@Mugen87
Copy link
Collaborator

Mugen87 commented May 9, 2017


var tracks = [];
// POSITION
var positionKF = new THREE.VectorKeyframeTrack('.position', [0, 1, 2], [0, 0, 0, 30, 0, 0, 0, 0, 0]);
Copy link
Collaborator

@Mugen87 Mugen87 May 9, 2017

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...

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 ]);
Copy link
Collaborator

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 ]

Copy link
Collaborator Author

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 🙁

@jostschmithals
Copy link
Contributor

@looeee 👍, but wouldn't it perhaps be nice to switch the single animations on/off via buttons?

@Mugen87
Copy link
Collaborator

Mugen87 commented May 9, 2017

Then it could also be expanded a little more to show how AnimationObjectGroup works, and maybe a couple of other simple things.

Would do this in a separate example.

@Mugen87
Copy link
Collaborator

Mugen87 commented May 9, 2017

but wouldn't it perhaps be nice to switch the single animations on/off via buttons?

I would keep it simple. @looeee's implementation is fine.

@mrdoob mrdoob merged commit 38f2812 into mrdoob:dev May 14, 2017
@mrdoob
Copy link
Owner

mrdoob commented May 14, 2017

Thanks!

@looeee looeee deleted the misc_anim_keys_example_update branch January 27, 2022 10:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants