Lect24 Projections 1

download Lect24 Projections 1

of 29

Transcript of Lect24 Projections 1

  • 7/27/2019 Lect24 Projections 1

    1/29

    159.235 Graphics 1

    159.235 Graphics & Graphical

    Programming

    Lecture 24 - Projections - Part 1

  • 7/27/2019 Lect24 Projections 1

    2/29

    159.235 Graphics 2

    Projections - Outline

    3D Viewing

    Coordinate System & Transform Process

    Generalised Projections

    Taxonomy of Projections

    Perspective Projections

  • 7/27/2019 Lect24 Projections 1

    3/29

    159.235 Graphics 3

    3D Viewing

    Inherently more complex than 2D case.Extra dimension to deal with

    Most display devices are only 2D

    Need to use aprojection to transform 3Dobject or scene to 2D display device.

    Need to clip against a 3D view volume.

    Six planes.View volume probably truncated pyramid

  • 7/27/2019 Lect24 Projections 1

    4/29

    159.235 Graphics 4

    Coordinate Systems & Transform

    ProcessObject coordinate systems.

    World coordinates.

    View Volume

    Screen coordinates.

    Raster

    Transform

    Project

    Clip

    Rasterize

  • 7/27/2019 Lect24 Projections 1

    5/29

    159.235 Graphics 5

    Generalised Projections.

    Transforms points in a coordinate system of dimension n

    into points in one of less than n (ie 3D to 2D)

    The projection is defined by straight lines calledprojectors.

    Projectors emanate from a centre of projection,pass

    through every point in the object and intersect a

    projection surface to form the 2D projection.

  • 7/27/2019 Lect24 Projections 1

    6/29

    159.235 Graphics 6

    Projections. In graphics we are generally only interested in planar

    projectionswhere the projection surface is a plane.

    Most cameras employ a planarfilm plane.

    But the retina is not a plane - future devices such asdirect retina devices may need more complex projections

    We will only deal with geometric projectionsthe

    projectors are straight lines.

    Many projections used in cartography are either non-

    geometric or non-planar.

    ExceptionImage-based rendering - advanced topic

  • 7/27/2019 Lect24 Projections 1

    7/29

    159.235 Graphics 7

    Projections.

    Henceforth refer to planar geometric projections as just:

    projections.

    Two classes of projections :

    Perspective. Parallel.

    A

    B

    A

    B

    A

    B

    A

    B

    Centre ofProjection.

    Centre of

    Projection

    at infinity

    Parallel

    Perspective

    Parallel

  • 7/27/2019 Lect24 Projections 1

    8/29

    159.235 Graphics 8

    A Taxonomy of Projections

    Planar geometric projections.

    Parallel Perspective

    Orthographic Oblique 1 point

    2 point

    3 point

    Axonometric

    Isometric

    CavalierCabinet

    Elevations

  • 7/27/2019 Lect24 Projections 1

    9/29

    159.235 Graphics 9

    Perspective Projections. Defined by projection plane and centre of projection.

    Visual effect is termedperspective foreshortening.

    The size of the projection of an object varies inversely withdistance from the centre of projection.

    Similar to a camera - Looks realistic !

    Not useful for metric information

    Parallel lines do not in general project as parallel.

    Angles only preserved on faces parallel to the projectionplane.

    Distances not preserved

  • 7/27/2019 Lect24 Projections 1

    10/29

    159.235 Graphics 10

    Perspective

    The first ever painting(Trini ty w ith the Virgin ,

    St. John and Donors)

    done in perspective by

    Masaccio, in 1427.

  • 7/27/2019 Lect24 Projections 1

    11/29

    159.235 Graphics 11

    Perspective Projections

    A set of lines not parallel to

    the projection plane

    converge at a vanishing

    point.

    Can be thought of in 3D as theprojection of a point at

    infinity.

    Homogeneous coordinate is 0

    (x,y,0)

  • 7/27/2019 Lect24 Projections 1

    12/29

    159.235 Graphics 13

    Perspective Projections

    z

    x

    y

    Projection plane

    xz

    y

    Lines parallel to a principal axis converge at an axisvanishing point. Categorized according to the number of such points

    Corresponds to the number of axes cut by the projection plane.

  • 7/27/2019 Lect24 Projections 1

    13/29

    159.235 Graphics 14

    1-Point Projection

    Projection plane cuts 1

    axis only.

  • 7/27/2019 Lect24 Projections 1

    14/29

    159.235 Graphics 15

    1-Point Perspective

    A painting (The

    Piazza of St. Mark,

    Venice) done byCanaletto in 1735-

    45 in one-point

    perspective

  • 7/27/2019 Lect24 Projections 1

    15/29

    159.235 Graphics 16

    2-Point Perspective

    y

    z x

    Projection plane

  • 7/27/2019 Lect24 Projections 1

    16/29

    159.235 Graphics 17

    2-Point Perspective

    Painting in two point

    perspective by

    Edward Hopper

    The Mansard Roo f

    1923 (240 Kb);

    Watercolor on paper,13 3/4 x 19 inches;

    The Brooklyn

    Museum, New York

  • 7/27/2019 Lect24 Projections 1

    17/29

    159.235 Graphics 18

    3-Point PerspectiveGenerally held to add little beyond 2-point perspective.

    y

    z x

    Projection plane

    A painting (City

    Night, 1926) by

    Georgia O'Keefe, that

    is approximately in

    three-point

    perspective.

  • 7/27/2019 Lect24 Projections 1

    18/29

    159.235 Graphics 19

    Intro to Projections -Summary 3D Viewing

    Coordinate System & Transform Process

    Generalised Projections

    Taxonomy of Projections

    Perspective Projections Clipping can be done in image

    space if more efficientapplication dependent.

    Parallel Projections next Acknowledgement - Thanks to Eric McKenzie, Edinburgh, from whose Graphics

    Course some of these slides were adapted.

  • 7/27/2019 Lect24 Projections 1

    19/29

    159.235 Graphics 20

    Parallel Projections

    Specified by a direction to the centre of projection,rather than a point.

    Centre of projection at infinity.

    Orthographic

    The normal to the projection plane is the same as thedirection to the centre of projection.

    Oblique Directions are different.

  • 7/27/2019 Lect24 Projections 1

    20/29

    159.235 Graphics 21

    Orthographic Projections

    Most common orthographic

    Projection :

    Front-elevation,

    Side-elevation,Plan-elevation.

    Angle of projection parallel to

    principal axis; projection plane

    is perpendicular to axis.

    Commonly used in technical

    drawings

  • 7/27/2019 Lect24 Projections 1

    21/29

    159.235 Graphics 22

    Axonometric Orthographic Projections

    Projection plane not normal to principal axis

    Show several faces of the object at once

    Foreshortening is uniform rather than being

    related to distance Parallelism of lines is preserved

    Angles are not

    Distances can be measured along each principalaxis ( with scale factors )

  • 7/27/2019 Lect24 Projections 1

    22/29

    159.235 Graphics 23

    Isometric Projection

    Most common axonometric projection Projection plane normal makes equal

    angles with each axis.

    i.e normal is (dx,dy,dz), |dx| = |dy|=|dz|

    Only 8 directions that satisfy this

    condition.

  • 7/27/2019 Lect24 Projections 1

    23/29

    159.235 Graphics 24

    Isometric Projection

    Normal

    x

    z

    y

    Projection

    Plane

    y

    z x

    120

    120

    120

    All 3 axes equally foreshortened

    - measurements can be made

    - Hence the name iso-metric

  • 7/27/2019 Lect24 Projections 1

    24/29

    159.235 Graphics 25

    Oblique projections.

    Projection plane normal differs from the direction

    of projection.

    Usually the projection plane is normal to aprincipal axis.

    Projection of a face parallel to this plane allows

    measurement of angles and distance.

    Other faces can measure distance, but not angles.

    Frequently used in textbooks : easy to draw !

  • 7/27/2019 Lect24 Projections 1

    25/29

    159.235 Graphics 26

    Oblique projection

    x

    z

    y

    Projection

    Plane

    Normal

    Parallel to x axis

  • 7/27/2019 Lect24 Projections 1

    26/29

    159.235 Graphics 27

    Geometry of Oblique Projections

    Projection plane is x,y plane

    L=1/tan()

    - angle between normal and projectiondirection

    - Determines the type of projection

    is choice of horizontal angle.

    Given a desired L and ,

    Direction of projection is

    (L.cos, L.sin,-1)

    z

    y

    x

    P

    L

    P=(0,0,1)

    L.sin

    L.cos

  • 7/27/2019 Lect24 Projections 1

    27/29

    159.235 Graphics 28

    Geometry of Oblique Projections

    Point P=(0,0,1) maps to:

    P=(l.cos, l.sin, 0) on xy plane,

    and P(x,y,z) onto P(xp,yp,0)

    )sin(

    )cos(

    lzyy

    lzxx

    p

    p

    1000

    0000

    0sin10

    0cos01

    l

    l

    Moband

  • 7/27/2019 Lect24 Projections 1

    28/29

    159.235 Graphics 29

    Mathematics of Viewing

    Need to generate the transformation

    matrices for perspective and parallel

    projections. Should be 4x4 matrices to allow general

    concatenation.

    And theres still 3D clipping and moreviewing stuff to look at.

  • 7/27/2019 Lect24 Projections 1

    29/29

    159.235 Graphics 30

    Projections - Summary

    Orthographic matrix - replace (z) axis withpoint.

    Perspective matrixmultiply w by z.Clip in homogeneous coordinates.

    Preserve z for hidden surface calculations.

    Can find number of vanishing points.

    Acknowledgments - thanks to Eric McKenzie, Edinburgh, from whoseGraphics Course some of these slides were adapted.