CS 491 -- Fall Quarter 2022

Project #3: Forward Kinematics (Hierarchical Transformations)

Due: October 19

100 Points


This page was last updated: October 7, 2022


Requirements

You are to create one new function to determine the overall GLM matrices for the problem we looked at in the class notes:

The Forward( ) function takes as inputs Theta1, Theta2, Theta3 (in degrees), and the lengths L1, L2.
Its outputs are the three transformation matrices: [M1/g], [M2/g], [M3/g].

Here is a prototype of forward.cpp to start with:


void
Forward( float th1, float th2, float th3,  float l1, float l2, glm::mat4& m1g, glm::mat4& m2g, glm::mat4& m3g )
{
}

void
WhoAmI( std::string &yourName, std::string &yourEmailAddress )
{
        yourName = "Joe Graphics";
        yourEmailAddress = "jgraphics@oregonstate.edu" ;
}

Note: All the matrix manipulation is to be done with GLM. Do not write any of your own matrix manipulation code.

Testing and Debugging

I will give you a .o file to test with. It will be similar to the grading program I will use. But, it will only tell you your final score. If you don't get full credit, it will not tell you what you are getting wrong. It is meant to reassure, not to replace your own testing!

How to Reassure Yourself That You Will Get Full Credit

Click here to get the test03.o file to test with. It is just like the grading program I will use, but it will only tell you your final score. If you don't get full credit, it will not tell you what you are getting wrong. It is meant to reassure, not to replace your own testing and debugging!

Use it like this (assuming the file you are planning to turn in is called proj03.cpp):

g++ proj03.cpp test03.o -o proj03
./proj03

For those of you using your own Linux system and getting "PIE" error messages, try this version of the .o file: Click here to get the test03B.o file to test with.

Because you are compiling separate from my code, you will need the following lines up at the top:


#include <stdio.h>
#include <string>
#ifndef _USE_MATH_DEFINES
#define _USE_MATH_DEFINES
#endif
#include <cmath>

#ifndef GLM_FORCE_RADIANS
#define GLM_FORCE_RADIANS
#endif
#include "glm/vec2.hpp"
#include "glm/vec3.hpp"
#include "glm/mat4x4.hpp"
#include "glm/gtc/matrix_transform.hpp"
#include "glm/gtc/matrix_inverse.hpp"

You will not need these lines in your final turnin .cpp file.

Note that when you run your own tests, you will need a main( ) program. You must not have a main( ) program when you run with test02.o or when you turn in your .cpp file. In those two cases, I am providing the main( ) program.

Do not turn in the entire graphics program! Just turn in your Forward( ) and your WhoAmI( ) functions in a single .cpp file.

Graphics Template:

However, if you want to visually see if your program is working, here is ForwardTemplate.zip, a graphics template program and all the Visual Studio stuff that goes with it. Just unzip all of this into a separate folder and double click on the .sln file.

Turn-In

Your electronic turnin will be done at http://engr.oregonstate.edu/teach and will consist of:

  1. Your source file (named forward.cpp)

This is due at 23:59:59 on the listed due date.

This project will be auto-graded by a script that will append a main program to your functions, compile the combination, run the executable, and see if your functions produce the right numbers. The script that compiles your functions will use exactly the g++ seen before. If your function does not compile and link, your grade on this project will be a zero.

Grading

For grading, I will link your Forward function in with my test program and see if you get the right answers.

If your code does not compile, then your grade for this project is a zero!

FeaturePoints
M1g25
M2g35
M3g40
TOTAL100

This is Easy -- What Could Possibly Go Wrong?

Plenty...