Graphics Reference
In-Depth Information
This is the starting point of this recipe.
4. If you want to preview the crow animation, click on the
play
button or use the
Alt
+
A
key combination.
We have also provided an example that you can open in your browser to see
the same animation in a Three.js scene. When you open the
07.05-create-
skeleton-animation-in-blender.html
example in your browser, you should
see something like this:
How to do it…
Before we can use the model in Three.js, we first have to export it from Blender:
1. To start the export, first navigate to
File
|
Export
|
Three.js
.
2. In the window that opens, we can select a destination and a filename. For
this recipe, name the file
crow.js
and set the destination to the
assets/
models/bones
folder.
3. Before we hit the
Export
button, we need to configure some Three.js-specific
properties. You can do this in the panel on the left-hand side in the
Ex-
port Three.js
section. In that section, make sure that the
Bones
,
Skinning
,
and
Skeletal
animation checkboxes are selected. If the
Morph Animation
checkbox is selected, disable it. Once you've checked the box, click on the
Export
button.
4. Now that we've exported the model, the first thing we need to do in Three.js
is load the model using
THREE.JSONLoader
: