-
-
Notifications
You must be signed in to change notification settings - Fork 389
#189 #258
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
Merged
Merged
#189 #258
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
086f77c
Adds doc for Sphere, Tetrahedron, Text, Torus, Torusknot, Tube - remo…
hirako2000 2d00c04
Fixes doc for CameraComponent and Component - #189
hirako2000 6b2480d
Adds more doc for ModuleSystem, AnimationModule and ResizeModule, als…
hirako2000 281f438
Adds missing @instance to instance methods as jsdoc defaults to `stat…
hirako2000 2fc05fd
Removes reference of WHS in example snippets - #189
hirako2000 3320fa8
Adds tutorial page for using the AnimationModule - #189
hirako2000 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,78 @@ | ||
| # Animation Clips | ||
|
|
||
| The Animation Module provides a convenient approach to animate your models. | ||
| Three.js provides an animation system, but you would need to setup the animation mixer, actions, and clips for your models. | ||
| With the `AnimationModule`, a few lines of code is enough to get going with playing various loops your models might have. | ||
|
|
||
| ### Pipeline | ||
|
|
||
| A simple pipeline with Blender to get animated models on the browser: | ||
|
|
||
| #### Blender | ||
| - Model your mesh | ||
|
|
||
| Modeling your mesh first, here is the model used in the Alien animation example. | ||
|
|
||
|  | ||
|
|
||
| - Add bones | ||
|
|
||
| Then add bones to form the armature of the model for animation. | ||
|
|
||
|  | ||
|
|
||
| - Weight assign (Skin/Rig) | ||
|
|
||
| Assign weight to vertices for the bones to influence. | ||
|
|
||
|  | ||
|
|
||
| - Add animation frames | ||
|
|
||
| Create frames to start animating, here using animation frames. | ||
| Use the dope sheet/actions editor. | ||
|
|
||
|  | ||
|
|
||
| - Animation names | ||
|
|
||
| Your model might have multiple animations (actions/clips), here is the given name for the single animation created for this model. | ||
|
|
||
|  | ||
|
|
||
| - Export | ||
|
|
||
| Finally, export to three.js json format, use the Blender exporter plugin, and ticket the appropriate options. | ||
|
|
||
|  | ||
|
|
||
|
|
||
| #### Whitestorm | ||
| - Create the animation module, passing your `app` as parameter. | ||
|
|
||
| ```js | ||
| const animationModule = new AnimationModule(app); | ||
| ``` | ||
|
|
||
| - Import your model as a SkinnedMesh, then play your clip | ||
|
|
||
| ```js | ||
| new Importer({ | ||
| parser(geometry, materials) { | ||
| return new THREE.SkinnedMesh(geometry, materials); | ||
| }, | ||
|
|
||
| url: `path/to/model.json`, | ||
| useCustomMaterial: true, | ||
|
|
||
| material: new THREE.MeshStandardMaterial({ | ||
| skinning: true | ||
| }), | ||
|
|
||
| modules: [animationModule] | ||
| }).addTo(app).then(() => { | ||
| animationModule.play('clipName'); | ||
| }); | ||
| ``` | ||
|
|
||
| That's it. The clip will kick off after the model is loaded, playing the given clip name. | ||
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+115 KB
docs/template/static/images/animation-clips/alien-weights-to-bones.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Just an idea:
How about this? :
Looks good as to me, and no global variables:D
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.
it looks good, I will edit this next time I edit the example. there will be more to come for ease-in/out.