Objects - PowerPoint PPT Presentation

1 / 3
About This Presentation
Title:

Objects

Description:

aka Polygonal Mesh (6.2) Objects are hollow and made of faces that share common edges Faces are considered to be outward facing Data Structure vertex list (geometry) – PowerPoint PPT presentation

Number of Views:21
Avg rating:3.0/5.0
Slides: 4
Provided by: Universi248
Learn more at: https://cis.gvsu.edu
Category:
Tags: objects

less

Transcript and Presenter's Notes

Title: Objects


1
Objects
  • aka Polygonal Mesh (6.2)
  • Objects are hollow and made of faces that share
    common edges
  • Faces are considered to be outward facing
  • Data Structure
  • vertex list (geometry)
  • face list (topology)
  • normal list (orientation)
  • normal list ignored by uisGL
  • Sample Data
  • grissom/367/DATA
  • several files .3vn
  • Sample code
  • uisObject Obj // define
  • ifstream datafile
  • datafile.open(file.3vn, iosin)
  • datafile gtgt Obj // reads data from file
  • datafile.close()
  • numV Obj.getNumVertices()
  • numF Obj.getNumFaces()

2
Rendering Faces
  • Faces are made of an ordered sequence of points
    (counter clockwise is the convention)
  • Assumed to be planar and convex
  • Triangles are often used
  • Face
  • uisVertex P
  • uisFace F1, F2 // define
  • P F1.getVertex(2) // get third vertex of face
  • size F1.getNumVertices()
  • See documentation for additional operations
  • Group Activity
  • write pseudo code to render a face

3
Rendering Objects
  • Pseudo code
  • For each Face
  • Draw Face
  • OpenGL code
  • uisObject Obj // define
  • in_file gtgt Obj // reads data from file
  • for i0 to Obj.getNumFaces()
  • Face Obj.getFace(i)
  • glBegin(GL_LINE_LOOP)
  • for j 0 to Face.getNumVertices()
  • P1 Face.getVertex(j)
  • glVertex3fv(P1)
  • glEnd( )
  • Group Activity
  • Write pseudo code to render an object
Write a Comment
User Comments (0)
About PowerShow.com