Interactive Computer Graphics CS 418 Spring 2011 M P3 Teapot Contest - - PowerPoint PPT Presentation

interactive computer graphics
SMART_READER_LITE
LIVE PREVIEW

Interactive Computer Graphics CS 418 Spring 2011 M P3 Teapot Contest - - PowerPoint PPT Presentation

Interactive Computer Graphics CS 418 Spring 2011 M P3 Teapot Contest Office Hours TA: Gong Chen Location: 1322 Siebel Center Email: gchen10 at illinois.edu Time: Monday 4pm-5pm MP3 Requirement Explained 10% Load Triangles 10%


slide-1
SLIDE 1

Interactive Computer Graphics

CS 418 – Spring 2011

MP3 Teapot Contest

TA: Gong Chen

Email: gchen10 at illinois.edu Office Hours Location: 1322 Siebel Center Time: Monday 4pm-5pm

slide-2
SLIDE 2

MP3 Requirement Explained

 10% Load Triangles  10% rendering using perspective correct  20% realistic lighting  20% texture mapping  10% environment reflection (environment

mapping)

 10% documentation  10% impressiveness

slide-3
SLIDE 3

Loading Triangles

 C++ fstream simplifies the reading process  Read in a list of vertices and faces  For each vertex calculate its texture

coordinates using the cylindrical coordinate formula given on the MP description

 For each face update per vertex normal

  • Need to check if the addition of normals increases

magnitude.

 Use glutSolidTeapot to check for correctness

slide-4
SLIDE 4

Texture Mapping-Basic Flow

 PPM online converter

  • http://www.sciweavers.org/free-online-image-converter

 glGenTexture(…) //generate texture names  glBindTexture(…)//bind texture name to target  glTexParameteri(…)//for given texture (ex.

GL_TEXTURE_2D) specify parameters

 glTexImage2D(…)//for the initialized texture object

specify texture data

 Refer to the demo code  Previous demo also showed how to use use the

build2dMipmap option

Initialize texture

  • bject
slide-5
SLIDE 5

Reference on texture functions

 http://www.opengl.org/sdk/docs/man/xhtml/

glGenTextures.xml

 http://www.opengl.org/sdk/docs/man/xhtml/

glBindTexture.xml

 http://www.opengl.org/sdk/docs/man/xhtml/

glTexParameter.xml

slide-6
SLIDE 6

Lighting

 Covered in previous discussion  Demo in MP2

  • If you haven’t try to understand the code for

lighting in MP2

slide-7
SLIDE 7

Environment Mapping

 Check this out

  • http://www.nvidia.com/object/cube_map_ogl_tut
  • rial.html

 It is similar to texture mapping in that you use

similar functions to set up your texture

  • bject.