1 / 6

CS770/870

CS770/870. Class 5. Assignment 2. Create an articulated mannequin Has body, head Two arms with elbow joint Hand. Some basic 3D setup commands. glFrustum ( Left,Right , Bottom, Top, Near, Far); float light_position [] = {-10.0,20.0,20.0,1.0};

deanne
Download Presentation

CS770/870

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. CS770/870 Class 5

  2. Assignment 2 Create an articulated mannequin Has body, head Two arms with elbow joint Hand

  3. Some basic 3D setup commands • glFrustum(Left,Right, Bottom, Top, Near, Far); • float light_position[] = {-10.0,20.0,20.0,1.0}; • glLightfv(GL_LIGHT0,GL_POSITION, light_position); • glEnable(GL_COLOR_MATERIAL); • This allows you to color basic glut objects (sphere, cube) • glEnable(GL_LIGHTING); • glEnable(GL_NORMALIZE); • This enables you to scale a cube without messing up lighting • Why? • glutSolid Sphere(rad, lat, lon); • glutSolidCube(size);

  4. GL_PROJECTION GL_PROJECTION GL_MODELVIEW M  P Mv The only difference between Projection (P) and Modelview (Mv) is that you cannot pop P off the stack, and P is always applied. A RIGHT HANDED COORDINATE SYSTEM

  5. Order of rotations To rotate around an arbitrary point on an object and not have it move. Must translate to the center of rotation, rotate, translate back again. (Beware of scales) All rotations occur in your initial frame of reference + looking a positive direction along an axis. Exercise

  6. Use of Matrix Stack. • Push • Rotate Torso • Draw Torso • Push • Translate, Rotate and draw Right arm • + Deal with forearm and hand (more pushes and pops) • Pop • Push • Translate, Rotate and draw Right arm • +Deal with forearm and hand • Pop • Pop

More Related