This is an enhanced version of housework "Hierarchical Model and SSD" from MIT 6.837 course.
In addition to the basic functions (described in the homework requirement), some extra functions (as follows) are also implemented.
The code is mostly written in Windows. Tested on Visual Studio 2019.
Support loading multiple models.
Usage: Append filenames of multiple models as command line parameters:
a3 data/Model1 data/Model2
Implemented by controling translation offsets of the root joint.
Usage: Drag the sliders corresponding the browser item Root (Translation)
.
Triangle faces are colored according to the numbers of binding joints of the 3 vertices.
Usage: Press "c" to toggle vertex coloring when in "mesh view" mode.
Configuration:
Modify L26 of Mesh.cpp
to use different color schemes. Possible strings after #define
:
COLOR_SCHEME_1
COLOR_SCHEME_2
Users can create and display simple animations.
Usage:
-
Use the slider controls provided in the user interface to pose the model for the first keyframe.
-
Click the
Save Position File
option on the menu and save it as a.pos
file. -
Pose the model for the next keyframe. Make sure that the model does not change too much compared to the previous keyframe pose.
-
Click the
Save Position File
option on the menu and save it as another.pos
file. -
Repeat steps 3~4 until all keyframe poses have been saved to the corresponding
.pos
files. -
Write an
.anim
file in plain text format and store it in the same directory with all.pos
files.In the ".anim" file, the first line is the filename of the first keyframe pose, and each subsequent line has a decimal number and a filename (separated by a space) indicating the interpolation time (in seconds) between the current keyframe and the previous keyframe, and the filename of the current keyframe pose, respectively.
See animation/Model1.anim for example.
-
Load the
.anim
file in our program using theLoad Animation File
option on the menu. -
Click the
Play Animation Once
orPlay Animation Repeatedly
option on the menu to play the animation.
Configuration:
The number of frames per second (FPS) can be changed by modifying L311 of modelerui.cpp
, which is the initial value of m_animateFps
variable.