1 Modelling o The creation and manipulation of a system representation is termed modelling o Any single representation is called a model of the system. o There are mainly two kinds (conventional): o Descriptive (e.g. a set of equations or rules to define parameter relationships) o Graphical/volumetric (e.g. architectural and engineering system). How to represent these objects in computer Example Methods Polygonal Polygonal Models o The most common type of model used in 3D - store faces of the object as planar polygons o Each polygonal face may be represented by its vertices or edges o Physical properties of the object may also be held as part of the representation, for example colour, light, texture o Representation methods such as this are called Boundary Representations or B-reps. o This type of representation may also be used to represent an approximation to a curved surface, where the curved surface is approximated by planar polygonal patches 3D Modeling with Polygons o We construct 3D models using groups of polygons. o Each polygon is planar ⇒ we need a large number of small polygons to give the impression of curved surfaces: 48 polygons 120 polygons 300 polygons 1000 polygons Polygon Mesh A polygon mesh approximates the surface shape of an object by specifying a set of points in space these points representing vertices of various polygonal faces. we have 8 vertices and 6 (polygons) faces. A list of vertices for a polygon is created by looking at the polygon from the outside, listing the vertices in a counter-clockwise direction until a complete circle is made. Poly1 = {v1, v2, v3, v4} (front face) Poly2 = {v4, v3, v6, v5} (right face)
5
Embed
Example Methods Polygonal Models - Nottinghampszqiu/Teaching/Courses/G5BAGR/Slides/3-mod… · Polygon Mesh A polygon mesh approximates the surface shape of an object by specifying
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
1
Modelling
o The creation and manipulation of a system representation is termed modelling
o Any single representation is called a model of the system.
o There are mainly two kinds (conventional):
o Descriptive (e.g. a set of equations or rules to define parameter relationships)
o Graphical/volumetric (e.g. architectural and engineering system).
How to represent these objects in computer
Example Methods
Polygonal
Polygonal Models
o The most common type of model used in 3D - store faces of the object as planar polygons
o Each polygonal face may be represented by its vertices or edges
o Physical properties of the object may also be held as part of the representation, for example colour, light, texture
o Representation methods such as this are called Boundary Representations or B-reps.
o This type of representation may also be used to represent an approximation to a curved surface, where the curved surface is approximated by planar polygonal patches
3D Modeling with Polygonso We construct 3D models using groups of polygons.
o Each polygon is planar ⇒ we need a large number of small polygons to give the impression of curved surfaces:
A polygon mesh approximates the surface shape of an object by specifying a set of points in space these points representingvertices of various polygonal faces. we have 8 vertices and 6 (polygons) faces.
A list of vertices for a polygon is created by looking at the polygon from the outside, listing the vertices in a counter-clockwise direction until a complete circle is made.
o With each cell a note is kept as to whether that cell is occupied by the model or not.
o Obviously this method has limited accuracy.
o Typically methods are based on quadtrees and octrees.
Sweep Objects
o Define a polygon by its edges then sweep it along a path
o Special cases
o Surface of revolution: rotate edges about an axiso Extrusion: Sweep along a straight line
3
Geometric Models
o Geometric models are collections of components with well defined geometry and often interconnections between components, including engineering and architectural structures, and other chemical structures
o Geometric models often have a hierarchical structure included by a bottom up construction process. Components are used as building blocks to create higher levels entities, which in turn serve as building blocks for yet higher level entities, and so on
o Generally represented as a tree, with transformations and instances at any node
Geometric Models
Geometric Modeling
o Each node may have its own local coordinate system
o Most useful for animating polygonal meshes
o Rendered by traversing the tree, applying transformations, and rendering the instances
o Consider a walking robot:
o Does the entire robot move in the same way?
o Does the position of one part of the robot depend on other parts?
Constructive Solid Geometry
o Constructive solid geometry (CSG) is a technique used in solidmodeling. CSG is often, but not always, a procedural modelingtechnique used in 3D computer graphics and CAD.
o Constructive solid geometry allows a modeler to create a complex surface or object by using Boolean operators to combine objects.
o Often CSG presents a model or surface that appears visually complex, but is actually little more than cleverly combined ordecombined objects.
o In some cases, constructive solid geometry is performed on polygonal meshes, and may or may not be procedural and/or parametric.
Constructive Solid Geometry
o The simplest solid objects used for the representation are called primitives.
o Typically they are the objects of simple shape: cuboids, cylinders, prisms, pyramids, spheres, cones.
o The set of allowable primitives is limited by each software package.
o Some software packages allow CSG on curved objects while other packages do not.
o It is said that an object is constructed from primitives by means of allowable operations, which are typically Boolean operations on sets: union, intersection and difference.
o This object could be produced by gluing two rectangular blocks together and then drilling the hole
o in CSG terms the the union of two blocks is taken and then the difference of the resultant solid and a cylinder is carried out
o The basic primitive objects, the blocks and the cylinder, may have to be scaled to the correct size, possibly oriented and then placed in the correct positions relative to each other before the logical operations
Procedural Methods
o The pattern is produced by the code:
o polyline(ns+1,verts); for (i=0; i < nr; i++) { transverts(verts,ns,fc,fs); polyline(ns+1,verts);
} o where ns is the number of sides in
the polygon, nr is the number of repetitions of the polygon and the array verts holds the vertices of the current polygon. The function transverts applies a scaling and a rotation to the vertices at each step
Smoke Particle System
o Constantly create particles
o Particles move upwards, with turbulence added
o Draw them as partially transparent circles that fade over time
Particle Systems
o A particle has:o A position in the worldo Rules for how it moves over timeo Rules for how it is drawn
o A particle system:o Controls when particles are created and destroyedo Makes sure that all the particles are updated
Basic Ocean
o Ocean created with Computational Fluid Dynamics
5
Procedural Approach Procedural Approach
o Whilst being far from a solved problem, techniques have been developed for algorithmically generating convincing computer graphics models of landscapes, sea scapes, cloudscapes, forests, urban environment
o OpenGL provides a set of routines (API) for 3D graphicso derived from Silicon Graphics GLo draws simple primitives (points, lines, polygons)o provides control over transformations, lighting, texture etc.
o In OpenGL, all geometry is specified by stating the type of object and then giving the vertices of the object
o glBegin(…) …glEnd()o glVertex[34][fdv]
o Three or four components (regular or homogeneous)o Float, double or vector (eg float[3])
o Primitives are defined by vertices, for example to draw a triangle:glBegin (GL_POLYGON);
b b -- bytebyteub ub -- unsigned byteunsigned bytes s -- shortshortus us -- unsigned shortunsigned shorti i -- intintui ui -- unsigned intunsigned intf f -- floatfloatd d -- doubledouble
VectorVector
omit “v” foromit “v” forscalar formscalar form
glVertex2f( x, y )glVertex2f( x, y )
Geometric Primitives
o All geometric objects in OpenGL are created from a set of basic primitives
o Certain primitives are provided to allow optimisation of geometry for improved rendering speed