Computer Graphics Imaging Ying Zhu Lecture 04 Transformation, View, and Projection
Before we start Short animation films to inspire your idea Go to GSU E-journal locator http://sfx.galib.uga.edu/sfx_gsu1/a-z/gsu_1 Type in “computer graphics” and search Select “Computer graphics proceedings, annual conference series” Click on “Association for Computing Machinery” If off-campus, use the ID on your Panther card to log in Click on “SVR: SIGGRAPH Video Review” Selected short animation films from SIGGRAPH conference 2001 - 2003
Project Teams Send me an email with a link to your team web site All I need is a web site with a list of team members
Today’s lecture Transformations View 3D projection Translate, rotate, and scale View The camera 3D projection Orthographic projection Perspective projection
Coordinate systems Each point and vector is defined in reference to a coordinate system Once we fix the origin of the coordinate system, we can represent all points unambiguously A 3D coordinate system is defined by its three base vectors (x, y, and z axis)
Geometric transformation In 3D graphics, animation is achieved by transforming geometric objects in the virtual world Transforming geometric objects means transforming points (vertices) and vectors Transformation of points and vectors can be conveniently achieved by matrix multiplications Introduced by Larry Roberts in 1966
Transformations in computer graphics There are three basic transformations in computer graphics Translation Rotation Scaling Sophisticated 3D animations can be achieved by concatenating a series of basic transformations
Translation Translation P’ P d x y
Scaling Scaling
Rotation Rotation about the origin Counter-clock wise rotation by 90 degree.
2D Transformation Summary Translation Scaling Rotation
3D Affine Transformations 3D affine transformations are an extension of the 2D transformations. Use 4x4 matrices instead of 3x3 matrices in 2D transformations. For example 3D scaling
3D Translation 3D translation matrix OpenGL function: glTranslatef(tx, ty, tz)
3D Scaling 3D scaling matrix OpenGL Function: glScalef(Sx, Sy, Sz)
3D Rotation About the Origin 3D rotation is more complicated than 2D rotation. Rotation about X axis Rotation about Y axis Rotation about Z axis
Transformations in Blender See Blender User’s Manual http://mediawiki.blender.org/index.php/Manual Interaction in 3D
3D Scenes and Camera In computer graphics, we often use terms that are analog to theatre or photography A virtual world is a “scene” Objects in the scene are “actors” There is a “camera” to specify viewing position and viewing parameters. Viewing and projection is about how to position the camera and project the 3D scene to a 2D image
Viewing There should be at least one camera in the scene You can switch cameras in the animation sequence Camera can be animated too The 3D scene is rendered through the viewpoint of the camera It’s important to make sure your objects are visible through the camera, not just your eyes Note the difference between a camera in CG and a real camera
Camera in computer graphics Computer graphics uses the pinhole camera model This results in perfectly sharp images Real cameras use lenses with variable aperture sizes This causes depth-of-field: out-of-focus objects appear blurry
Projection For each camera, there is a view volume for projection Everything inside the view volume will be projected to the 2D plane Everything outside the view volume will be “clipped” and ignored Two basic projections Orthographic projection Perspective projection
Orthographic Projection Projection lines are orthogonal to projection surface
Orthographic Projection Projection plane parallel to principal face Usually form front, top, side views isometric (not multiview orthographic view) front in CAD and architecture, we often display three multiviews plus isometric side top
Orthographic Projection Preserves both distances and angles Shapes preserved Can be used for measurements Building plans Manuals Cannot see what object really looks like because many surfaces hidden from view Often we add the isometric view
Perspective Projection Projectors converge at center of projection Perspective projection reflects real world experience
Perspective Projection The view frustum of perspective projection
Camera parameters in Blender The default projection in Blender is perspective projection, you can switch to orthographic view You can modify the following parameters in Blender Field of view Near plane Far plane
Camera parameters in Blender In 3D view, select camera, press F9 Demonstration
Summary Three basic transformations Translation Rotation Scaling Camera in CG is different from camera in the real world Two basic projections Orthographic projection Perspective projection
Readings See Blender User’s Manual Interaction in 3D (http://wiki.blender.org/index.php/Manual/Interact ion_in_3D)