|
|
|
In this assignment you will animate motions for an articulated humanoid figure. You will be given an articulated 3D model and sets of keyframes specifying the orientations of articulated joints at specific time steps. Your job is to interpolate the keyframes smoothly over a time interval so that the articulated figure performs animated actions (e.g., walks, dances, etc.).
An overview of the code you will be using can be found here.
An overview of the
.rayfile syntax can be found here.An overview of the
.keyfile syntax can be found here.Sample actor and key-frame files can be found here.
A (Windows x64) compiled version of the renderer implementing some of the basic features can be found here.
A (Linux) compiled version of the renderer implementing some of the basic features can be found here.
The OpenGL programming Guide is an invaluable resource in assisting with OpenGL implementation. You can find a link to the guide here.
You should use the same code-base as in previous assignments (Assignments.zip), as a starting point. As in the previous assignments, code modification should be relegated to the*.todo.cppfiles.After you copy the provided files to your directory, the first thing to do is compile the program. To do this, you will first have to compile the
JPEGlibrary and then compile theassignment4executable.On a Windows Machine
Begin by double-clicking onAssignments.slnto open the workspace in Microsoft Visual Studios.
- Compile the
Assignment4executable by right-clicking on "Assignment4" and selecting "Build". (If theJPEG.lib,Image.lib,Ray.lib, andUtil.liblibraries have not already been compiled, they will be compiled first.)- The executable
Assignment4.exeis compiled in Release mode for the 64-bit architecture and will be placed in the root directory.On a Linux Machine
- Type
make -f Makefile4to compile theAssignment4executable. (If thelibImage.a,libRay.a, andlibUtil.alibraries have not already been compiled, they will be compiled first.) This assumes that JPEG libraries have already been installed on your machine. (If it hasn't been installed yet, you can install it by typingsudo apt-get install libjpeg-dev.)- The executable
Assignment4is compiled in Release mode and will be placed in the root directory.- If you are having trouble linking either to the
gllibraries or theglulibraries, you should install the associated packages:For subsequent assignments, you should also install thesudo apt-get install libgl1-mesa-dev libglu1-mesa-devglutpackage:sudo apt-get install freeglut3-dev
In addition to rendering static models, this assignment will allow you to render animated 3D models. The key
to doing this is the class
DynamicAffineShape (in Ray/shapeList.[h/cpp]).
which represents a transformation node in the scene-graph hierarchy whose value is a function of the time elapsed. This object stores a pointer
DynamicAffineShape::_matrix to a Matrix4D. At each frame, the transformation DynamicAffineShape::_matrix is changed, and as a result, OpenGL renders a new image.
More specifically, animation is achieved through the use of the template class
KeyFrameData (in Ray/keyFrames.h
and Ray/keyFrames.inl). This class:
The executable takes in as a mandatory arguments the input (.ray) .ray file name. Additionally, you can also pass in the dimensions of the viewing window, the complexity of the tesselation for objects like the sphere, the cylinder, and the cone, the manner in which rotations should be parameterized, and the way transformations should be blended. It is invoked from the command line with:The% Assignment4 --in <input ray file> --width <width> --height <height> --cplx <complexity> --parameter <matrix representation> --interpolant <interpolation type>--parameterargument specifies how the rotations will be parameterized. Options includeThe
1: Rotations are represented by 3x3 matrices, the matrices are blended, and the blended transformation (not necessarily rotation) is returned.2: Rotations are represented by 3x3 matrices, the matrices are blended, and the closest rotation to the blended transformation is returned.3: Rotations are represented by Euler angles, the Euler angles are blended, and the rotation described by the blended Euler angles is returned.4: Rotations are represented by skew-symmetric matrices, the skey-symmetrice matrices are blended, and the exponential of the blended skew-symmetric matrix is returned.5: Rotations are represented by quaternions, the quaternions are blended, and the rotation described by the normalized blended quaternion is returned.--interpolantargument specifies how transformations should be blended. Options include:Feel free to add new arguments to deal with the new functionalities you are implementing. Just make sure they are documented.
1: Nearest point interpolation2: Linear interpolation3: Catmull-Rom interpolation4: Uniform cubic B-spline approximation
The assignment is worth 15 points. The following is a list of features that you may implement. The number in parentheses corresponds to how many points it is worth.
The assignment will be graded out of 15 points. In addition to implementing these features, there are several other ways to get more points:
- (1) The code you receive already parses apart the information in the
.keyfiles and makes the appropriate calls in the Window::IdleFunction (inRay/window.[h/cpp]) to update the values of the parameters. In order to obtain smooth animations, modify the Interpolation::Sample (inUtil/interpolation.todo.inl) method to support linear interpolation of the key-frame values. (This should be within theLINEARcase of theswitchstatement.
You should assume that the value of the interpolation parameter,t, is always between 0 and 1.- (2) The default representation of a rotation is by a 3x3 (not necessarily rotation) matrix. Consequently, even if the samples are rotations, interpolation can introduce unwanted scaling (as in the runner's legs in
Data/act/test.ray). Modify the code to support parametrization of rotations using Euler angles.
To do this, you will need to implement the operator EulerRotationParameter::operator() (inUtil/geometry.todo.cpp) which transforms the triplet of Euler angles into a rotation matrix.
Recall that the three Euler angles define a rotation which is the product of a rotation about the x-axes, multiplied on the left by a rotation about the y-axes, multiplied on the left by a rotation about the z-axes.- (2) Although using Euler angles guarantees that the in-between transformations are rotations, they can result in unwanted artifacts (such as the jiggling of the runner's legs in
Data/act/test.ray). To fix this problem, implement nearest rotation interpolation/approximation which blends together rotations and then returnes the closest rotation to the blend.
To do this, you will need to implement the code in Matrix::closestRotation (inUtil/geometry.todo.inl) which returns the rotation closest to the linear transformation described by theMatrixobject. (To help you on your way, the methods Matrix::SVD and Matrix::determinant have already been provided, giving the SVD decomposition of an arbitrary matrix as the product of a rotation, a diagonal, and another rotation matrix, and returning the determinant of a matrix. The Singular Value Decomposition is performed in such a way that the diagonal entries are non-negative and strictly non-increasing.)- (2) Implement quaternion parametrization of rotations.
To do this, you will need to implement the operator QuaternionRotationParameter::operator() (inUtil/geometry.todo.cpp) which generates a 3x3 matrix corresponding to a quaternion. (Keep in mind that the matrix is only a rotation if the quaternion is a unit quaternion.)- (2) Implement the parametrization of rotations by the 3x3 skew-symmetric matrices.
To do this, you will need to implement the function Matrix::Exp (inUtil/geometry.todo.inl) which computes the exponential of a matrix using the firsttermsterms of the Taylor approximation. Keep in mind that the Taylor series for the exponential function is:
exp(X)=1+X+X*X/(2!)+X*X*X/(3!)+...+X**k/(k!)+...
whereX**krepresentsXraised to thek-th power, andk!is "kfactorial" --k*(k-1)*(k-2)*...*2*1.- (2) Modify the Interpolation::Sample (in
Util/interpolation.todo.inl) method to support Catumull-Rom interpolation of the key-frame values. (This should be within theCATMULL_ROMcase of theswitchstatement.
- (2) Modify the Interpolation::Sample (in
Util/interpolation.todo.inl) method to support uniform cubic B-spline approximation of the key-frame values. (This should be within theUNIFORM_CUBIC_B_SPLINEcase of theswitchstatement.
- (2) Create a
.rayfile and a.keyfile describing an interesting animation. Do not use any of the.keyfiles provided with this assignment.- (2) Add the ability to composite two motions specified in separate
.keyfiles onto the same actor at the same time. Augment the.keyfiles to include a #Start time, and linearly blend between motions for the subsets of joints in both.keyfiles during transition periods. Demonstrate this feature with a hand waving motion composited onto a walking cycle.- (?) Impress us with something we hadn't considered...
- (1) Submitting one or more videos for the art contests.
- (1) Submitting one or more
.rayfiles for the art contests.- (1) Submitting one or more
.keyfiles for the art contests.- (2) Winning the video art contest.
- (2) Winning the
.rayfile art contest.- (2) Winning the
.keyfile art contest.It is possible to get more than 15 points. However, after 15 points, each point is divided by 2, and after 17 points, each point is divided by 4. If your raw score is 14, your final score will be 14. If the raw score is 18, you'll get 16.25. For a raw score of 21, you'll get 17.
geometry.todo.cpp, geometry.todo.inl, and interpolation.todo.inl.
artcontest.zip.
writeup.pdf
geometry.todo.cpp
geometry.todo.inl
interpolation.todo.inl
[artcontest.zip]
awesomevideo.mp4
interestingartpiece.ray
interestinganimation.[key/act/ray]
...