Week 01: Hello CS317!

Welcome to CS317: Computer Animation!

Lecture Topics:

  • From Java to C++

  • Setting up your development environment and course tools

  • Math overview

  • Introduction to animation

Lectures

Development environment

The primary goal of our first assignment will be to setup our development environment.

We will use git for sharing source code and resources.

Our development environment is based on

  • cmake: generates build files for creating executables on linux, mac, and windows

  • openGL: 3D drawing

  • GLM: math library

Everything will be setup in the Park Science Center labs (Rm 230 and Rm 231). You may want to setup your own laptop for development. Do it! It’s a great idea. Make sure your code runs in the lab, however, for full credit on your assignments.

To setup your development environment on your own machine, use the instructions in the following repository:

Math Overview

This class relies on vectors, matrices, and polynomials. Specifically,

Introduction to animation

Animation is the illusion of movement created by showing a series of static images very quickly (think: flipbook).

Framerate

The number of frames rendered (or displayed) each second. Typically measured in fps, or frames per second. For example, a framerate of 24 indicates that 24 frames are displayed each second. Conversely, the duration of each frame is 1/24.

Procedural animation

The animation is generated using an algorithm. Example might include a physical simulation or oscillating movement computed with sine and cosine.

Artist-driven animation

The animation is created by an artists, typically using a technique called key-framing. In a key-framed animation, the artist specifies the state of objects in the scene at different times. For example, an artist may use key frames to animate an object’s color, transparency, position, orientation, or size. Interpolation is then used to transition smoothly between keys. Artists use tools such as a dope sheet to keep track of the key frames on an object.

Data-driven animation

The animation is generated from a recording of movement. A popular example is optical motion capture, where reflective markers are used to keep track of the locations of different joints and landmarks on the body. This technique may also use retargeting to fit the recorded motion to a character with different proportions.

Further reading:

  • Parent 1.1, 1.3

From Java to C++

We will be using C. If you're familiar with Java, C supports the same programming features as Java.

If you would like extra practice in C++, try the exercises from the following repository.

Git

In lab, we briefly covered the git features that you will frequently need in this course. On windows, we will use git bash to run git commands. On mac and ubuntu, we will use a terminal.

Obtaining class repositories

Repositories for the class are hosted on Github from here.

You should fork the repositories into your own personal Github account.

Downloading a repository

git clone <url-to-repository>

The url can be obtained from Github. This command will download the source from github onto your local machine, e.g. your laptop or lab machine.

Updating a repository

To update your personal repository from BrynMawr-CS317-F21, click the "Fetch Upstream" button on Github.

To download changes from Github into your local repository, run

git pull

Adding files

git add <filename1> <filename2> ..
git add .
git add *.cpp

Call git add with the names of the files you want to add. Using "dot" will recursively add everything from the current directory. You can also use wildcards for filenames, such as git add *.cpp

To check the status of your repository, call

git status

It is always a good idea to frequently check the status to ensure that the correct files are being modified!

Commit a file

Once a file is added you can "commit" the file. Committed files have their state saved in the repository. You can always revert files to a previously committed state.

git commit -m <helpful message>
git commit --amend -m <helpful message>

It is best practice to always put a helpful message so you can find a desired commit later using git log You can also amend a previous commit message if you make a typo.

Fun fact: commit messages can contain emojis.

Merging

It is very common to have a conflict when pulling files into a local repository. When this happens, you need to decide whether to

  • keep the local changes (ours)

  • keep the remote changes (theirs)

  • keep a mix of the local and remote changes

To keep the local changes,

git checkout --ours <conflicted files>

To keep the remote changes,

git checkout --theirs <conflicted files>

To keep a mix of local and remote changes, edit the file. The file will contain both versions in text blocks surrounded by "<<<<<<<<". Tools exist to aid with resolving conflicts, but we will let you investigate what you like best. I personally think a simple text editor is often easiest.

Once you have resolved the merge, you should add and commit your changes.

Uploading changes

Committed changes must be uploaded to Github to be submitted.

git push

By default, we use HTTPS for transferring files between Github and our local machine. In some cases, this may not be supported. If HTTPS is not supported, you will need to setup SSH for transferring files.

To setup SSH for git, follow the instructions here

Additional resources:

(We will not use branches, tags or pull requests in this course.)