1 / 6

Professor: James Davis Email: davis@cs.ucsc TA : Indrani Chakravarty

Introduction to Computer Graphics (CMPS 160-Lab, Fall -2007) http://www.soe.ucsc.edu/classes/cmps160/Fall07/. Professor: James Davis Email: davis@cs.ucsc.edu TA : Indrani Chakravarty Email: ichakrav@ucsc.edu Lab Tutors: Bryan Harris and Chirag Dave

chibale
Download Presentation

Professor: James Davis Email: davis@cs.ucsc TA : Indrani Chakravarty

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. Introduction to Computer Graphics (CMPS 160-Lab, Fall -2007)http://www.soe.ucsc.edu/classes/cmps160/Fall07/ Professor: James Davis Email: davis@cs.ucsc.edu TA : Indrani Chakravarty Email: ichakrav@ucsc.edu Lab Tutors: Bryan Harris and Chirag Dave Email: bryan.harris@gmail.com, chirage@gmail.com Required Lab: M 10-12 or T 11-1 Optional Lab: W 10-12, Th 11-1

  2. Objective: To learn how to build an example program using open Graphics Library(openGL), and to compile and run it. Example of output from gltest.c Lab 0

  3. OpenGL and GLUT • OpenGL provides commands for • specifying geometric objects in 2 or 3 dimensions, e.g. points, lines, polygons, images etc, and • for controlling how these objects are drawn on the display (e.g. color). • OpenGL does not provide commands for performing windowing tasks or for obtaining user input. GLUT (the OpenGL Utility Toolkit) does. • The starter code gltest.c is a decent template for making any basic OpenGL program -- • it has callbacks to support mouse, keyboard (currently empty function bodies) and • it demonstrates some animations and transformations.

  4. Tasks (1) Compiling and Running the code • Download prog0.tgz from http://www.soe.ucsc.edu/classes/cmps160/Fall07/labs/lab0.html • Untar and unzip the file onto the local directory using • tar -xzvf prog0.tgz • Change the directory to prog0 • cd prog0 • Run the following and see the output • make • ./gltest • If you get an error while compiling • Open Makefile using any editor • Comment the following line and go back to Step 4 • CFLAGS += -O3 -ffast-math -mtune=G5 -mcpu=G5

  5. Tasks (2) Playing around with the code • See the effect of the following changes to the code, and try understanding what’s happening -- • Change the arguments of the Translation function and Rotation function • Change the • color of the teapot • color of the animations around the teapot • size of the teapot and the size of the animating cubes around the teapot • Find out what the following functions from the code do, and see their effect on the GUI -- • cb_reshape • cb_keyboard • Understand the code gltest.c

  6. For Online help • To know more about the openGL and GLUT functions used in this code, • Do a “man”. For example • $ man glRotatef • See the online copy of the RedBook on openGL at • http://www.opengl.org/documentation/red_book/

More Related