العام الدراسي 1436- 1437

advertisement
Viewing
Classical Viewing
 Viewing requires three basic elements
- One or more objects
- A viewer with a projection surface
- Projectors that go from the object(s) to the projection surface
Classical Viewing con..
 Viewing is based on the relationship among these
elements
-The viewer picks up the object and orients it
depending on how she would like to see it
 In Classical Viewing each object is assumed to
constructed from flat principal faces
- Buildings, manufactured objects.
Classical Projections
Planar Geometric Projections
Projection in computer graphics is a way of converting the object
in N-Dimensional system to N-1 Dimensions, For example
convert the objects in 3d to 2d .
• Projectors are lines that either
1) Converge at a center of projection
2) Or are parallel
• Such projections preserve lines but not necessarily angles
Projections
 Display device (a screen) is 2D…
 How do we map 3D objects to 2D space?
 2D to 2D is straight forward…
 2D window to world.. and a viewport on the 2D surface.
 Clip what won't be shown in the 2D window, and map the
remainder to the viewport.
 3D to 2D is more complicated…
 Solution : Transform 3D objects on to a 2D plane using
projections
Projections
 In 3D…
 View volume in the world
 Projection onto the 2D projection plane
 A viewport to the view surface
 Process…
 1… clip against the view volume,
 2… project to 2D plane, or window,
 3… map to viewport.
Projections
 Conceptual Model of the 3D viewing process
Types of projections
 2 types of projections
 perspective and parallel.
 Key factor is the center of projection.
 if distance to center of projection is finite : perspective
 if infinite : parallel
Perspective Projection
When the human eye views a scene, objects in the distance
appear
smaller than objects close by - this is known as perspective.
 Projectors converge at the center of Projection
 Parallel Lines not parallel to the Projection Plan
 Converge at a single Point in the projection
Parallel Projection
Parallel projections have lines of projection that are parallel both in
reality and in the projection plane .
2 principle types:
orthographic and oblique.
Orthographic :
direction of projection = normal to the projection plane.
Oblique :
Direction of projection != normal to the projection plane.
Orthographic Projection
When the human eye looks at a scene, objects in the distance appear
smaller than objects close by. Orthographic projection ignores this effect
to allow accurate measurements.
Common names for orthographic projections include cross-section, bird'seye, and elevation.
Projectors are orthogonal to projection surface.
Multiview Orthographic Projection
Projection plane parallel to principal faces•
Usually form front, top, side views•
Isometric (Not Multiview
Orthographic)
Front
View
In CAD and architecture, we
often display three multiviews
plus isometric
Side
View
Top
View
Oblique projections
 Arbitrary relationship between projector and Projection
Planes
 Objects can be visualized better then with orthographic
projections
 Can measure distances, but not angles*
* Can only measure angles for faces of objects parallel to the plane
Oblique Projection
Terminology of Planar Projections
Orthographic Advantages and Disadvantage
 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 therefore
-Often we add the isometric view as shown in previous slide
Axonometric Projections
Axonometric projection is a type of orthographic projection where
the plane or axis of the object depicted is not parallel to the projection
plane such that multiple sides of an object are visible in the same image.
•Allow projection Plane to move relative to Object as shown
in below Fig
•Classified by How many angles of projected cube are
same:
1) None --- Trimetric
2) Two ----- Dimetric
3) Three ---- Isometric
Types of Axonometric Projections
Advantages & Disadvantages
 Lines preserved but angles are not
- Projection of a circle in a plane not parallel to the projection
plane is an ellipse
 Does not look real because far objects are scaled the same as near
objects
 Used in CAD applications
World Cordinates
View corordinat
Device
PipeLine View
Three aspects of the viewing process implemented in the Computer
Graphics pipeline:
1) Positioning the camera i.e. Setting the model-view matrix
2) Selecting a lens i.e. Setting the projection matrix
3) Clipping i.e. Setting the view volume
The OpenGL Camera
 In OpenGL, initially the object and camera frames are the same
-Default model-view matrix is an identity
 The camera is located at origin and points in the negative z
direction
 OpenGL also specifies a default view volume that is a cube with
sides of length 2 centered at the origin
- Default projection matrix is an identity
Moving the Camera
 If we want to visualize object with both positive and negative z values we can
either:
- Move the camera in the positive z direction i.e. Translate the camera frame
-OR Move the objects in the negative z direction i.e. Translate the world
frame
 Both of these views are equivalent and are determined by the model-view
matrix
 Want a translation (glTranslatef(0.0,0.0,-d);) where d > 0
Default Frames
Frames after Translation by –d (d>0)
We can move the Camera at any desired Location by a
sequence of Translation & Rotational movement
Example: Side view
1) Rotate Camera
2) Move it away from Origin
3) Model View Matrix C=TR
View Port Transformation
From working viewport to the coordinate of Display device as shown in
below figure
Download