Week 03 Coordinate Systems&Transformations

Embed Size (px)

Citation preview

  • 7/29/2019 Week 03 Coordinate Systems&Transformations

    1/18

    Coordinate

    systems2D & 3D

    MCS

    WCS

    VCSNPC

    DCS

  • 7/29/2019 Week 03 Coordinate Systems&Transformations

    2/18

    WXW

    Y

    WX

    WY

    Working Plane

    The WP in the prompts and in the picker stands forWorking Plane a movable, 2-D reference planeused to locate and orient primitives. By default, the WP origin coincides with the global origin,

    but you can move it and/or rotate it to any desiredposition.

    By displaying a grid, you can use the WP as a drawingtablet.

    X2

    X1 Y2

    Y1WP (X,Y)

    Working Plane CoordinateSystems

    Attached to the working plane.

    Used mainly to locate and orient solid model primitives.

    You can also use the working plane to define keypoints bypicking.

  • 7/29/2019 Week 03 Coordinate Systems&Transformations

    3/18

    Global Coordinate Systems

    The global reference system for the model.May be Cartesian (system 0), cylindrical (1), orspherical (2).

    For example, location (0,10,0) in global Cartesian isthe same as (10,90,0) in global Cylindrical.

    Local Coordinate SystemsA user-defined system at a desired location,

    with ID number 11 or greater. The locationmay be: At WP origin [CSWP]

    At specified coordinates [LOCAL]

    At existing keypoints [CSKP] or nodes [CS]

    May be Cartesian, cylindrical, or spherical.

    May be rotated about X, Y, Z axes.

    X

    Y

    X11

    Y11

    X12Y12

  • 7/29/2019 Week 03 Coordinate Systems&Transformations

    4/18

    Screen Coordinate System

    Screen layout

    The Right-Hand Rule

    It provides an easy-to-understandreference to determine the positiveand negative directions of the X, Y,and Z axes.

    Knowing how to use this

    simple reference makes iteasier to visualize theelationships of the X,Y, and Zaxes in 3D space.

  • 7/29/2019 Week 03 Coordinate Systems&Transformations

    5/18

    Units

    Solid modeling systems use generic unitsinternally. Units are user specifiedeither at creation of model or at point ofoutput.

    Within the database values are unitlessCAD systems typically supply units atoutput.

    For example, when printing hardcopy ortransferring data between applications.

    Coordinate system

    Allows for the mapping of positionsandorientations in a 3 dimensional modelspace.

    Is required to describe the shape ofobjectsand for monitoring changes in thoseshapes.

    Is used to ensure relevance between3Dmodeling structures and their real worldcounterparts.

  • 7/29/2019 Week 03 Coordinate Systems&Transformations

    6/18

    Computer graphics

    Using X,Y,Z Point Coordinates

    Three-dimensional (3D) models areconstructed in 3D space - typically in aright-handed cartesian coordinate system.

    There will normally be a fixed coordinatesystem which is used for the overall

    definition of the model.

    Computer graphics

    Using X,Y,Z Point Coordinates

    We will call this the global coordinate system(GCS) - and, integer screen (absolute)coordinate system corresponds to thenumber of pixels on the screen, in addition, amovable world coordinate system (WCS) maybe used to assist in the construction of themodel.

  • 7/29/2019 Week 03 Coordinate Systems&Transformations

    7/18

    Computer graphics

    Coordinate formats (3-dimensional):

    Cartesian or rectangular

    Cylindrical polar

    Spherical

    Cartesian Coordinate System

    Most common format used in CAD systems

    spherical and polar systems do not permitvectorization

    Consists of a set of three mutually orthogonalaxes, intersecting in a common point or

    origin.Orientation is typically right-handed.

  • 7/29/2019 Week 03 Coordinate Systems&Transformations

    8/18

    Right-handed coordinte system

    (0,0,0)+X

    +Y

    +ZDirection ofpositiverotation isgiven by theright-hand rule

    Temporary Coordinate SystemMany also provide for the

    specification of temporary Local(or User-Defined) CoordinateSystems.

    Used to simplify input

    Data input is specified relative totemporary system

    Data are transformed to absolutereference internally

    +X

    +Y

    +Z

    +X

    +Z

    +Y

  • 7/29/2019 Week 03 Coordinate Systems&Transformations

    9/18

    Reference Planes

    Many modelers will allow forthespecification of new localcoordinatesystems by specifyinga reference (XY) plane

    May be located with respect toexisting model geometry:

    aligned with existingvertices, edges, surfaces) or to coordinate location

    (e.g. Z = Z)

    +X

    +Y

    +Z

    X

    Z=ZY

    Z1

    World & Image Space CoordinateSystems

    A model is reduced to a picture by systematictransformation through several coordinatesystems.

    The user's coordinate system, commonly calledworld spaceis the highest level, while the devicespaceis the lowest.

  • 7/29/2019 Week 03 Coordinate Systems&Transformations

    10/18

    World & Image Space CoordinateSystems

    Device space

    The actual coordinate system by which pointsare plotted on the graphics device.This is usually measured in pixels. On the SGImachines, the lower left corner of your windowis (0,0), with x values increasing to the right and

    y values increasing upward.

    World & Image Space CoordinateSystems

    Screen Space

    It is defined to be the square-1 x, y 1 on the x,y plane.

    Most drivers for specific graphics devices arewritten to map this space onto device space.

  • 7/29/2019 Week 03 Coordinate Systems&Transformations

    11/18

  • 7/29/2019 Week 03 Coordinate Systems&Transformations

    12/18

    World & Image Space CoordinateSystems

    World SpaceThe coordinate system of the scene that is tobe projected into image space for viewing.

    A mapping is usually constructed that maps anarea of world space into the image space volume-1 x,y,z 1 .

    Computer graphics

    PointsIn 2D a single point can be presented by x y

    coordinates.

    [IX IY] = [x y] T

    IX , IY : integer display coordinatesx, y : global life size coordinatesT : transformation matrix (2x2)

    In 3D [IX IY] = [x y z] TT : 3x2 matix

  • 7/29/2019 Week 03 Coordinate Systems&Transformations

    13/18

    Geometric Transformations

    Modeling systems operate on model entities(and hence the database) through threetransformation operations.

    Translation is a straightforward movement.

    Rotation does not affect the size or shape ofthe object.

    Scaling (dilation) changes the size of the image

    without changing the shape.

    Translation

    Rigid body transformation

    Every point of entity movedequally a specified distance in aspecified linear direction

    May be specified in terms of:

    Initial and final location of areference point

    A delta value with respect to thecurrent coordinate system x

    y

    x, y

    x, y

  • 7/29/2019 Week 03 Coordinate Systems&Transformations

    14/18

    Rotation

    A rigid body rotation in whichevery point of an entity isrevolved an equal amount about areference.

    Requires a rotation axis andangle In the case of a 2Drotation, point view of axis isused

    x

    y

    x, y

    Dilation (scaling)Alters the absolute size of an entityby multiplying its geometriccoefficients by a scale factor.

    Scale factor may be applied equally inX, Y and Z directions Entity shape remains the same

    Scale factor may be applieddifferently in X,Y or Z Entity shape changes

    Requires a base point x

    y

    x, y

  • 7/29/2019 Week 03 Coordinate Systems&Transformations

    15/18

    Geometric TransformationsRotation of a triangle through 45 about origin.

    y

    x0

    A

    B

    C

    A

    BC

    A(1,1) B(2.5, 1.5) C(1.5, 2.5)

    For point A

    For point B

    For point C

    Geometric Transformations

    Mirror image about the y-axis.

    y

    x0

    A

    B

    C

    AB

    C

    A(1,1) B(2.5, 1.5) C(1.5, 2.5)

  • 7/29/2019 Week 03 Coordinate Systems&Transformations

    16/18

    Homogeneuos Coordinates

    The H-coordinate can be thought of as anextra scale factor, it is not the z-axis.

    Several possible transformations betweenglobal and homogeneuos coordinates areachived by changing H.

    Homogeneuos Coordinates

    To enable multiplication, an extra element that can beset to unity is needed:

    An extra coordinate is needed, which isconventionally called H.

  • 7/29/2019 Week 03 Coordinate Systems&Transformations

    17/18

    2D Homogeneuos Coordinates

    The extra dimension is conventionally calledthe H-axis and although the picture data isin 2D [x, y] coordinates, using a 3x3transformation matrix makes themathematics very much easier.

    [X Y H] where x = X/H & y = Y/H

    3D Homogeneuos Coordinates

    Any point with global coordinates (x y z) canbe scaled as (X Y Z H) where

    x=X/H, y=Y/H and z=Z/H;

    thus, for 3D global coordinates, a 4x4transformation matrix is used.

  • 7/29/2019 Week 03 Coordinate Systems&Transformations

    18/18

    3D Homogeneuos Coordinates

    (x y z 1) = (X/H Y/H Z/H 1)

    (X Y Z 1) = (x y z 1) T

    whereThe 3x3 matrix produces

    scaling, shearing and rotation.

    The 1x3 matrix produces

    traslation,

    the 3x1 matrix generates a

    projection and

    the 1x1 matrix gives an extra

    scale factor

    Model displayAccomplished by mapping 3Dpositions to a 2D viewing plane(the screen).

    same projection techniquesused in engineering graphics

    The X x Y matrix of mapped

    points is stored in a memorydevice referred to as thescreen buffer.

    Projection is based upon usedline-ofsight

    Y

    X