object representations
Post on 13-Jan-2015
2.127 Views
Preview:
DESCRIPTION
TRANSCRIPT
Computer Graphics
Object RepresentationsObject Representations
Taher S.Taher S.
Object RepresentationsObject Representations
Taher S.Taher S.
Recap: Rendering Pipeline
• Modeling transformationsModeling transformations
• Viewing transformationsViewing transformations
• Projection transformationsProjection transformations
• ClippingClipping
• Scan conversionScan conversion
We now know everything about how to draw a We now know everything about how to draw a polygon on the screen, we now learn how to polygon on the screen, we now learn how to represent them efficiently using appropriate data represent them efficiently using appropriate data structures.structures.
• Modeling transformationsModeling transformations
• Viewing transformationsViewing transformations
• Projection transformationsProjection transformations
• ClippingClipping
• Scan conversionScan conversion
We now know everything about how to draw a We now know everything about how to draw a polygon on the screen, we now learn how to polygon on the screen, we now learn how to represent them efficiently using appropriate data represent them efficiently using appropriate data structures.structures.
Types of Objects
Polygon Surfaces (Order =1)Polygon Surfaces (Order =1)
Quadric Surfaces (Order <=2)Quadric Surfaces (Order <=2)
SphereSphere
EllipsoidEllipsoid
TorusTorus
Curved Lines and Surfaces (Order <=3)Curved Lines and Surfaces (Order <=3)
Spline RepresentationsSpline Representations
Polygon Surfaces (Order =1)Polygon Surfaces (Order =1)
Quadric Surfaces (Order <=2)Quadric Surfaces (Order <=2)
SphereSphere
EllipsoidEllipsoid
TorusTorus
Curved Lines and Surfaces (Order <=3)Curved Lines and Surfaces (Order <=3)
Spline RepresentationsSpline Representations
Object Representation Methods
Boundary Representations (B-reps)Boundary Representations (B-reps)
The B-reps describes a 3D object as a set of surfaces that The B-reps describes a 3D object as a set of surfaces that separate the object interior from the environmentseparate the object interior from the environment
Space PartitioningSpace Partitioning
The Space partitioning representation describes interior The Space partitioning representation describes interior properties by partitioning the spatial region containing an object properties by partitioning the spatial region containing an object into a set of small, non-overlapping, contiguous solids.into a set of small, non-overlapping, contiguous solids.
Boundary Representations (B-reps)Boundary Representations (B-reps)
The B-reps describes a 3D object as a set of surfaces that The B-reps describes a 3D object as a set of surfaces that separate the object interior from the environmentseparate the object interior from the environment
Space PartitioningSpace Partitioning
The Space partitioning representation describes interior The Space partitioning representation describes interior properties by partitioning the spatial region containing an object properties by partitioning the spatial region containing an object into a set of small, non-overlapping, contiguous solids.into a set of small, non-overlapping, contiguous solids.
Types of Data Structures
Polygon TablesPolygon Tables
Plane EquationsPlane Equations
Polygon MeshesPolygon Meshes
BSP Trees BSP Trees
OctreesOctrees
Polygon TablesPolygon Tables
Plane EquationsPlane Equations
Polygon MeshesPolygon Meshes
BSP Trees BSP Trees
OctreesOctrees
Binary Space Partition Trees (1979)
BSP tree: organize all of space (hence BSP tree: organize all of space (hence partitionpartition)) into a binary treeinto a binary tree
• PreprocessPreprocess: overlay a binary tree on objects in the scene: overlay a binary tree on objects in the scene
• RuntimeRuntime: correctly traversing this tree enumerates objects : correctly traversing this tree enumerates objects from back to frontfrom back to front
• Idea: divide space recursively into half-spaces by choosing Idea: divide space recursively into half-spaces by choosing splitting planessplitting planes
– Splitting planes can be arbitrarily orientedSplitting planes can be arbitrarily oriented
BSP tree: organize all of space (hence BSP tree: organize all of space (hence partitionpartition)) into a binary treeinto a binary tree
• PreprocessPreprocess: overlay a binary tree on objects in the scene: overlay a binary tree on objects in the scene
• RuntimeRuntime: correctly traversing this tree enumerates objects : correctly traversing this tree enumerates objects from back to frontfrom back to front
• Idea: divide space recursively into half-spaces by choosing Idea: divide space recursively into half-spaces by choosing splitting planessplitting planes
– Splitting planes can be arbitrarily orientedSplitting planes can be arbitrarily oriented
BSP Trees: Objects
BSP Trees: Objects
BSP Trees: Objects
BSP Trees: Objects
BSP Trees: Objects
Rendering BSP Trees
Rendering BSP Trees
Polygons: BSP Tree Construction
Split along the plane defined by any polygon from Split along the plane defined by any polygon from scenescene
Classify all polygons into positive or negative Classify all polygons into positive or negative half-space of the planehalf-space of the plane• If a polygon intersects plane, split polygon into two and If a polygon intersects plane, split polygon into two and
classify them bothclassify them both
Recurse down the negative half-spaceRecurse down the negative half-space
Recurse down the positive half-spaceRecurse down the positive half-space
Split along the plane defined by any polygon from Split along the plane defined by any polygon from scenescene
Classify all polygons into positive or negative Classify all polygons into positive or negative half-space of the planehalf-space of the plane• If a polygon intersects plane, split polygon into two and If a polygon intersects plane, split polygon into two and
classify them bothclassify them both
Recurse down the negative half-spaceRecurse down the negative half-space
Recurse down the positive half-spaceRecurse down the positive half-space
No bunnies were harmed in my exampleNo bunnies were harmed in my example
But what if a splitting plane passes through an But what if a splitting plane passes through an object?object?• Split the object; give half to each nodeSplit the object; give half to each node
No bunnies were harmed in my exampleNo bunnies were harmed in my example
But what if a splitting plane passes through an But what if a splitting plane passes through an object?object?• Split the object; give half to each nodeSplit the object; give half to each node
Discussion: BSP Tree Cons
Ouch
Octrees
Frequently used in modern video gamesFrequently used in modern video games
• A BSP tree subdivides space into a series of half-spaces A BSP tree subdivides space into a series of half-spaces using single planesusing single planes
• An octree subdivides space into eightAn octree subdivides space into eightvoxels using three axis-aligned planesvoxels using three axis-aligned planes
– A voxel is labeled as havingA voxel is labeled as havingpolygons inside it or notpolygons inside it or not
Frequently used in modern video gamesFrequently used in modern video games
• A BSP tree subdivides space into a series of half-spaces A BSP tree subdivides space into a series of half-spaces using single planesusing single planes
• An octree subdivides space into eightAn octree subdivides space into eightvoxels using three axis-aligned planesvoxels using three axis-aligned planes
– A voxel is labeled as havingA voxel is labeled as havingpolygons inside it or notpolygons inside it or not
www.gamasutra.com/features/19970801/octree.htmwww.gamasutra.com/features/19970801/octree.htmwww.gamasutra.com/features/19970801/octree.htmwww.gamasutra.com/features/19970801/octree.htm
Octrees
• A voxel may have geometry inside it or subdivideA voxel may have geometry inside it or subdivide
– Can have as many as eight childrenCan have as many as eight children
• Thus we partition 3-D space into Thus we partition 3-D space into 3-D cells3-D cells
• Checking visibility with polygons isChecking visibility with polygons isnow faster due to only checkingnow faster due to only checkingparticular cellsparticular cells
• Quadtrees are a 2-D variantQuadtrees are a 2-D variant
• A voxel may have geometry inside it or subdivideA voxel may have geometry inside it or subdivide
– Can have as many as eight childrenCan have as many as eight children
• Thus we partition 3-D space into Thus we partition 3-D space into 3-D cells3-D cells
• Checking visibility with polygons isChecking visibility with polygons isnow faster due to only checkingnow faster due to only checkingparticular cellsparticular cells
• Quadtrees are a 2-D variantQuadtrees are a 2-D variant
Quadric Surfaces:
• SphereSphere
• EllipsoidEllipsoid
• TorusTorus
• ParaboloidParaboloid
• HyperboloidHyperboloid
• SphereSphere
• EllipsoidEllipsoid
• TorusTorus
• ParaboloidParaboloid
• HyperboloidHyperboloid
Sphere:
Cartesian form:
Parametric Form:
Ellipsoid:
Cartesian form:
Parametric Form:
Clifford Torus
Turning a punctured torus
inside-out
Torus:
As the distance to the axis of revolution decreases, the ring torus becomes a spindle torus and
then degenerates into a sphere.
Cartesian form:
Parametric Form:Red arrow : φ Blue arrow : θ
Paraboloid:
Hyperboloid:
One -SheetTwo- Sheet
top related