CS675 Assignment 3 (Droids - Modelling and Rendering)

Anshuman Kumar and Ravi Chalasani

a3/screenshot.png

R2D2 meets a humanoid robot at Union Square (SFO)

Table of Contents

1 Modelling the Environment

A textured environment cube is used for the environment. In the screenshot above, an outside environment is shown. It is also possible to have an indoor environment.

2 Modelling the Humanoid Droid: Hierarchical Tree and DOFs

The following hierarchial model was used for the humanoid robot:

a3/humanoid_hierarchial_tree.jpg

Humanoid model's hierarchial tree

humanoid droid's DOFs
JointNr. of DOFs
hip/torso1
torso/shoulder3
hip/thigh3
elbow1
knee1

3 Modelling The Non-Humanoid Droid: Hierarchical Tree and DOFs

Initially the following tree was used, but it was cumbersome to make the torso bend. Doing so involved first rotating the torso and then rotating the legs in the opposite direction. As the torso was the root, rotating it, rotated the whole model.

a3/r2d2_initial_hierarchial_tree.jpg

R2D2's initial hierarchical tree

So a dummy root node, labelled `axle' below was used to attach the legs to.

a3/r2d2_hierarchial_tree.jpg

R2D2's hierarchical tree

R2D2's DOFs
JointNr. of DOFs
axle/torso1
torso/head1

4 Lighting and Textures

Several primitive shapes were coded up (partial ellipsoids, cuboids, conical frustrums) and for each of these, along with the vertex coordinates and color, texture coordinates and normals were computed and stored. These were used to apply textures and compute lighting respectively.

The basic struct for storing vertices is:

struct Point
{
    float x;
    float y;
    float z;
    float w;
    float cx; 
    float cy; 
    float cz;
    float ca;
    float nx; 
    float ny; 
    float nz; 
    float tx;
    float ty;
};
using PointV = std::vector<Point>;

4.1 Example Textures

a3/texture3.jpg

Texture used on humanoid robot

a3/r2d2_torso.jpg

R2D2 torso texture

4.2 Lighting

As required two general directional lights to light the scene, and one spot light on the robots have been placed. The keys to control these lights are described in the keyboard bindings section.

5 Keyboard Bindings

Keyboard Bindings
keybinding
ESCquit application
tabswap controlled robot
jtoggle light 1
ktoggle light 2
ltoggle spot light
1bend forward at hip
2bend backward at hip
3bend left hand forward at elbow
4bend right hand forward at elbow
3r2d2: rotate head left
4r2d2: rotate head right
5bend left hand backward at elbow
6bend right hand backward at elbow
7bend arms backward at shoulder
8bend arms forward at shoulder
9bend arms up at shoulder
0bend arms down at shoulder
qmake humanoid robot walk
arrow keysrotate perspective camera
z, xmove perspective camera forward/backward
w, smove robot forward/backward
a, drotate robot about y axis

Author: Anshuman Kumar, Ravi Chalasani <anshu266man@gmail.com>

Date: 2015-10-20 22:39:51 IST