200 likes | 427 Views
Geometric objects and Transformations. Workshop on Computer Graphics & Visualization. Objectives. Introduce standard transformations Rotation Translation Scaling Shear Derive homogeneous coordinate transformation matrices
E N D
Geometric objects and Transformations Workshop on Computer Graphics & Visualization www.Bookspar.com | Website for Students | VTU - Notes - Question Papers
Objectives • Introduce standard transformations • Rotation • Translation • Scaling • Shear • Derive homogeneous coordinate transformation matrices • Learn to build arbitrary transformation matrices from simple transformations www.Bookspar.com | Website for Students | VTU - Notes - Question Papers
transformation ROBOT upper body lower body stanchion base head trunk arm Scene graph Geometric Transformations How Are Geometric Transformations Used in Computer Graphics? Object construction using assemblies/hierarchy of parts of Sketchpad’s masters and instances; leaves of scene graph contain primitives “is composed of hierarchy” www.Bookspar.com | Website for Students | VTU - Notes - Question Papers
Aid to realism • objects, Help form 3D “object hypothesis” • kinesthetic feedback as user manipulates objects or synthetic camera • City planning application program • Applications use geometric transformations to change position, orientation, and size of the objects • CAD www.Bookspar.com | Website for Students | VTU - Notes - Question Papers
2D Object Definition • Lines and Polylines • Polylines: lines drawn between ordered points • Same first and last point make closed polyline or polygon • If it does not intersect itself, called simple polygon www.Bookspar.com | Website for Students | VTU - Notes - Question Papers
Convex vs. Concave Polygons Convex: For every pair of points in the polygon, the line between them is fully contained in the polygon Concave: Not convex: some two points in the polygon are joined by a line not fully contained in the polygon www.Bookspar.com | Website for Students | VTU - Notes - Question Papers
triangle square rectangle • Special polygons Circles • Consist of all points equidistant from one • predetermined point (the center) • (radius) r = c, where c is a constant P1 r y r P0 x 0 • On a Cartesian grid with center of circle at origin equation is r2 = x2 + y2 www.Bookspar.com | Website for Students | VTU - Notes - Question Papers
Circle as polygon • A circle can be represented by a polygon with many sides (>15). www.Bookspar.com | Website for Students | VTU - Notes - Question Papers
6 6 5 5 4 4 3 3 2 2 1 1 0 0 1 2 3 4 5 6 7 8 9 10 10 1 2 3 4 5 6 7 8 9 Ellipses A circle scaled along the x or y axis Example: height, on y-axis, remains 3, while length, on x-axis, changes from 3 to 6 www.Bookspar.com | Website for Students | VTU - Notes - Question Papers
2D to 3D Object Definition • Vertices in motion (“Generative object description”) • Line is drawn by tracing path of a point as it moves • (one dimensional entity) • Square drawn by tracing vertices of a line as it moves • perpendicularly to itself (two dimensional entity) • Cube drawn by tracing paths of vertices of a square • as it moves perpendicularly to itself (3-D entity) • Circle drawn by swinging a point at a fixed length • around a center point www.Bookspar.com | Website for Students | VTU - Notes - Question Papers
Building 3D Primitives • Triangles and tri-meshes www.Bookspar.com | Website for Students | VTU - Notes - Question Papers
Often parametric polynomials, called splines Patches Curves Boundaries are Polynomial curves In 3D www.Bookspar.com | Website for Students | VTU - Notes - Question Papers
Transformations in OpenGL • Modeling • Viewing • orient camera • projection • Animation • Map to screen www.Bookspar.com | Website for Students | VTU - Notes - Question Papers
Camera Analogy & Transformations 3D is just like taking a photograph • Projection transformations • adjust the lens of the camera • Viewing transformations • tripod–define position and orientation of the viewing volume in the world • Modeling transformations • moving the model • Viewport transformations • enlarge or reduce the physical photograph www.Bookspar.com | Website for Students | VTU - Notes - Question Papers
Coordinate Systems & Transformations • Steps in Forming an Image • specify geometry (world coordinates) • specify camera (camera coordinates) • project (window coordinates) • map to viewport (screen coordinates) • Each step uses transformations • Every transformation is equivalent to a change in coordinate systems (frames) www.Bookspar.com | Website for Students | VTU - Notes - Question Papers
Transformations A transformation is a function that maps points to other points and/or vectors to other vectors Importance in graphics is that we need only transform endpoints of line segments and let implementation draw line segment between the transformed endpoint v=T(u) Q=T(P) www.Bookspar.com | Website for Students | VTU - Notes - Question Papers
Affine Transformations • Transformations which preserve geometry • lines, polygons, quadrics • Affine = line preserving • Rotation, translation, scaling • Projection • Concatenation (composition) • Characteristic of many physically important transformations • Rigid body transformations: rotation, translation • Scaling, shear www.Bookspar.com | Website for Students | VTU - Notes - Question Papers