Proseminar Web3D 3D Computer Fundamentals Part I - PowerPoint PPT Presentation

1 / 33
About This Presentation
Title:

Proseminar Web3D 3D Computer Fundamentals Part I

Description:

3-D Computer Fundamentals (Part I) Christian Tr bswetter. Naoufel Boulila. TUM 2002 ... Stairs in lines, patterns in surfaces, optical illusions in videos ... – PowerPoint PPT presentation

Number of Views:79
Avg rating:3.0/5.0
Slides: 34
Provided by: wwwbrueg
Category:

less

Transcript and Presenter's Notes

Title: Proseminar Web3D 3D Computer Fundamentals Part I


1
Proseminar Web3D3-D Computer
Fundamentals (Part I)
Naoufel Boulila
  • Christian Trübswetter

TUM 2002
2
Content
  • 2-D/3-D Transformations
  • Rasterization of 2-D Primitives
  • 2-D/3-D Clipping

3
2-D/3-D Transformations
  • What is a transformation?
  • What kind of transformations are there?
  • How can I compute them?

4
Rasterization of 2-D Primitives
  • What is rasterization?
  • What are the difficulties?

5
2-D/3-D Clipping
  • Clipping sounds simple
  • But usually it isnt
  • Problems with convexe polygons
  • 3-D clipping

6
Transformations
 
  • 2-D Translation
  • Scaling
  • Rotation
  • 3-D Basics
  • 3-D Rotation
  • Characteristics of the 3-D Space
  • Optimizations
  • Projection Transformation
  • Perspective Projection
  • Fixed Point Arithmetics

 
2-D/3-D Transformations
7
Translation in 2-D
 
Figure Translation of a set of points,
translation of space.
Point-Vector /- Translation-Vector new
Point-Vector
2-D/3-D Transformations
8
2-D Scaling
 
 Figure Scaling transformation.
  • Computation
  • Scalar Vector Vector

2-D/3-D Transformations
9
Rotation in the Plane
 
With 2-D Rotation Matrix Rotation-Matrix
Point-Vector Point-Vector
 
Figure 2.8 Rotating the coordinate system.
2-D/3-D Transformations
10
3-D Basics
 
  • Spaces and Angles
  • Roll (alpha, Z-axis), pitch (beta, X) and yaw
    (gamma, Y)

 
Figure 3-D Coordinates
2-D/3-D Transformations
11
3-D Rotations
 
  • Mathematical representation by a special kind of
    3-by-3 matrix
  • A point (array or vector) is multiplied by a
    rotation matrix in order to get the new
    coordinates
  • Multiplication of matrixes equals combined
    rotations
  • Associative but not commutative

 
2-D/3-D Transformations
12
Characteristics of the 3-D Space
 
  • Different mathematical representation
  • Representation of translation with addition of a
    vector
  • Scaling by multiplying scalar
  • Rotate with multiplication of matrixes
  • What we want uniform behaviour of all those
    transformations
  • Problem 3 by 3 matrix not possible, because
    translation requires affine, not linear
    transformation
  • Solution 4 by 4 matrix

 
2-D/3-D Transformations
13
Optimizations
 
  • Sums instead of multiplications
  • Frequent computation of sin, cos
  • Matrix elements contain lots of trig. Functions
  • Taylor Power Series, first two summands
  • Precomputation of values
  • Iterative algorithms

2-D/3-D Transformations
14
Projection Transformation
  • Mapping 3-D coordinates into 2-D screen
  • Parallel projection

 
Figure Parallel projection.
2-D/3-D Transformations
15
Perspective Projection
 
  • Perspective Projection
  • - xxfocus/z

  Figure Perspective projection.
  Figure Geometry of perspective projection.  
  • Problems
  • Singularity at z0
  • Division is costly
  • Visibility changes after perspective
    transformation

 
2-D/3-D Transformations
16
Fixed Point Arithmetics
 
  • Good fast additions and subtractions esp. when
    no floating point unit
  • Bad overflow more likely

 
2-D/3-D Transformations
17
Rasterization
 
  • Rasterizing Points
  • Rasterizing Line Segments
  • Rasterizing Polygons
  • Rendering Interpolatively Shaded Polygons
  • Rendering Textured Polygons
  • Anti-Aliasing

 
Rasterization of 2-D Primitives
18
Rasterizing Points
 
  • Points and pixels
  • Discrete nature of pixels
  • Address of pixel (x,y) is ysize(X)x

 
Figure Image bitmap layout.
Rasterization of 2-D Primitives
19
Rasterizing Line Segments
 
  • Finding points on a line
  • Computation of the y-coordinate for every
    discrete x-value
  • Problems
  • - Which pixel(s) should be drawn
  • - Degeneration of vertical lines
  • - Computing every pixel necessary?
  • Iterative computing of lines

 
Figure 3.3 Calculating Y function of X verses X
function of Y for some line.
Rasterization of 2-D Primitives
20
Rasterizing Polygons
 
  • Different kinds of polygons
  • Simple, convex, concave, semi-simple
  • Scanlines

 
  Figure Concave and convex polygons.  
Rasterization of 2-D Primitives
21
Rasterizing convex Polygons
 
  • One scanline
  • Horizontal lines

 
Figure Array to store polygons pixel lines.
Rasterization of 2-D Primitives
22
Rasterizing concave Polygons
  • Division in convex polygons
  • Disadvantage two many objects, lines are doubled
  • Special algorithms for concave P.
  • Ordered, active/passive edges

 
Figure Steps in finding convex polygons pixel
lines.
Rasterization of 2-D Primitives
23
Rendering Interpolatively Shaded Polygons
 
  • Pixels with additional values
  • Linear interpolation

 
  Figure Interpolatively shaded polygons.
Figure 3.14 Interpolating color intensities.
Rasterization of 2-D Primitives
24
Rendering Textured Polygons
 
  • Warping when using linear mapping
  • In case of shading normally its not noticed
  • Solution Scanline subdivision, approximations

  Figure Linear texture mapping. Note unnatural
warping.
Figure Linear texture mapping for a
perspectively projected polygon.
 
  Figure Perspective texture mapping.
Figure Scanline subdivision and linear
approximation.
Rasterization of 2-D Primitives
25
Anti-Aliasing
 
  • Discrete nature of pixels and frames causes
    undesirable effects
  • Stairs in lines, patterns in surfaces, optical
    illusions in videos

 
Figure Filtering.
Rasterization of 2-D Primitives
26
Clipping
  • 2-D Clipping Strategies
  • Clipping Points
  • Clipping Line Segments
  • Clipping Polygons
  • 3-D Clipping Strategies

2-D/3-D Clipping
27
2-D Clipping Strategies
 
  • Preclipping for simple primitives and rectangle
    clip. area
  • Clipping during Rasterization for more complex
    primitives
  • Postclipping for complex clipping areas

 
  Figure Different types of clipping.  
2-D/3-D Clipping
28
Clipping Points
 
  • Easy for rectangle clipping area
  • - check if point is in the x- and y-range
  • For others clipping areas
  • - go through with scanline
  • - check range(s)

2-D/3-D Clipping
29
Clipping Line Segments
 
  • Trivial rejection, based on region outcodes
  • In case of acceptance clipping of he line against
    an edge
  • Intersection computed by binary search

 
Figure Outcodes.
Figure Clipping a segment against a vertical
edge.
2-D/3-D Clipping
30
Clipping Polygons
 
  • Clip polygons iteratively against all edges
  • Determine intersection points, new vertices, new
    edges
  • Problem convex polygons
  • - More than one part possible
  • - How to treat them

 
Figure 4.8 Iterating polygons edges against a
single clipping edge.
Figure A scan-line coinciding with the
horizontal edge.
2-D/3-D Clipping
31
3-D Clipping Strategies
 
  • Clipping in case of parallel projection
  • - Rectangular clipping areas
  • Perspective clipping very complex and time
    consuming
  • Singularities/overflow for near objects
  • Limited number of primitives
  • No 3-D effects for far objects
  • Simplify the clipped volume perspective angles
    of 90
  • Bounding boxes for detaild objects

 
Figure Bounding box and sphere for an object of
complex geometry.    
2-D/3-D Clipping
32
Summary
  • Transformation techniques allow to describe
    location, orientation and motion of virtual
    objects and also their visibility to the viewer
  • The rasterization routines are used to picture
    geometric primitives. Shading and texture mapping
    can be added to improve visual realism
  • Clipping discards the objects in the world space
    which would not contribute to the generation of
    the image

2-D/3-D Clipping
33
Thats it
  • Thank you for listening
  • Questions please
Write a Comment
User Comments (0)
About PowerShow.com