Miriah Meyer University of Utah

Miriah Meyer University of Utah

cs6630 | November 6 2014 3D GRAPHICS Miriah Meyer University of Utah 1 administrivia . 2 - lectures and office hours next week ! - new due date for final assignment 3 last time . 4 Volume Visualization • 2D visualization slice images (or multi-planar reformating MPR) • Indirect 3D visualization isosurfaces (or surface-shaded display SSD) • Direct 3D visualization (direct volume rendering DVR) © Weiskopf/Machiraju/Möller 19 Volume Visualization • 2D visualization slice images (or multi-planar reformating MPR) • Indirect 3D visualization isosurfaces (or surface-shaded display SSD) • Direct 3D visualization (direct volume rendering DVR) © Weiskopf/Machiraju/Möller 19 Compare Properties • Preimage of a single scalar value: • Concept generalizes to any dimension • Closed except at boundaries • Nested: isocontours of different isovalues do not cross • Can consider the zero-set case (generalizes) • f(x,y) = v ⇔ f(x,y) - v = 0 • Normals given by gradient vector of f() ApproachContours to Contouring in 2D in 2D ••Idea:Contour primitives must cross must every cross grid lineevery connecting grid line two connectinggrid points of two opposite grid signpoints of opposite sign Identify grid Get cell Find crossings lines w/cross x Interpolate along grid lines x Primitives naturally chain together + - CS530 - Introduction to Scientific Visualization Oct 7, 2014, Case Table 10 today . 11 3D Graphics • The key idea for today: • Visualization transforms data into primitives that are rendered using (three-dimensional) computer graphics techniques Graphics Primitives Graphics Primitives Points • Positions in space • 2D, 3D coordinates • 0-dimensional objects CS530CS - 530Introduction - Introduction to Scientific to Scientific Visualization Visualization - 08/27/2014 Graphics Primitives Lines • 1-dimensional objects • Polygonal description (”polyline”) • piecewise linear CS530CS - 530Introduction - Introduction to Scientific to Scientific Visualization Visualization - 08/27/2014 Graphics Primitives Lines • 1-dimensional objects • Parametric description • P : t I P (t) IR n 2 7! 2 • e.g., splines P (t) CS530CS - 530Introduction - Introduction to Scientific to Scientific Visualization Visualization - 08/27/2014 Graphics Primitives Surfaces • 2-dimensional objects (in 3D) • Polygonal description • Important topologies (special cases) 8 6 2 4 7 1 3 5 triangle fan triangle strip quad strip CS530CS - 530Introduction - Introduction to Scientific to Scientific Visualization Visualization - 08/27/2014 Graphics Primitives Surfaces • 2-dimensional objects • Polygonal description • typically: triangle mesh (piecewise linear) CS530CS - 530Introduction - Introduction to Scientific to Scientific Visualization Visualization - 08/27/2014 Graphics Primitives Surfaces • 2-dimensional objects • Parametric description • P :(u, v) I J P (u, v) IR n ⇤ × ⌅⇥ ⇤ • bi-quadratic, bi-cubic, Bezier, splines, NURBS... CS530CS - 530Introduction - Introduction to Scientific to Scientific Visualization Visualization - 08/27/2014 Primitive Attributes Color Normal Opacity Texture coordinates CS530CS - 530Introduction - Introduction to Scientific to Scientific Visualization Visualization - 08/27/2014 The Graphics Pipeline Primitives The Pipeline Modeling/Transformation Camera Transformation • Objects are kept and manipulated in 3D until the Lighting projection step • Projection / Clipping After converting to screen space coordinates, additional coloring and texturing can be applied Rasterization more rapidly Texturing http://en.wikipedia.org/wiki/Graphics_pipeline Modeling/Transformation • Each 3D primitive is assigned locations in the world coordinate system. • Transformations can be applied globally or locally to individual objects in this space • Homogeneous coordinate spaces are used so that we can express translations in 3D. Transformations stored as 4x4 matrices Camera Image plane View up View angle Focal point Direction of Camera projection position Parallel / Perspective Front clipping plane • Need to specify eye position, eye direction,Back clippingand eye plane orientation (or “up” vector) • This information defines a transformation from world coordinates to camera coordinates CS530CS - 530Introduction - Introduction to Scientific to Scientific Visualization Visualization - 08/27/2014 33 Camera • Degrees of freedom Elevation Focal Point Direction of projection Roll Azimuth CS530CS - 530Introduction - Introduction to Scientific to Scientific Visualization Visualization - 08/27/2014 Projections Orthogonal projection • parallel lines remain parallel • objects do not change size as they get closer • good for checking alignment CS530CS - 530Introduction - Introduction to Scientific to Scientific Visualization Visualization - 08/27/2014 Projections Perspective projection • parallel lines do not necessarily remain parallel • objects get larger as they get closer • fly-through realism CS530CS - 530Introduction - Introduction to Scientific to Scientific Visualization Visualization - 08/27/2014 Orthographic vs. Perspective Projections Dianne Hansford Perspective Projection • Maps points in 4D (where it is easier to define the view volume and clipping planes) to positions on the 2D display through multiplication and homogenization Shading Shading • Shading reveals the shape of 3D objects through their interaction with light • Shading creates colors as a function of: • surface properties • surface normals • lights • Rich subject (we are only interested in basics here) • Surfaces show information, lights show surfaces, shading controls how CS530CS - 530Introduction - Introduction to Scientific to Scientific Visualization Visualization - 08/27/2014 Shading Phong lighting model (1975) • Specular reflection • Diffuse reflection • Ambient reflection CS530CS - 530Introduction - Introduction to Scientific to Scientific Visualization Visualization - 08/27/2014 17 Shading Phong lighting model (1975) • Specular reflection • Diffuse reflection • Ambient reflection Light intensity per light source and per color channel I = ksIs + kdId + kaIa CS530CS - 530Introduction - Introduction to Scientific to Scientific Visualization Visualization - 08/27/2014 17 Shading Phong lighting model (1975) • Specular reflection • Diffuse reflection • Ambient reflection Light intensity per light source and per color channel I = ksIs + kdId + kaIa relative contributions (material specific) CS530CS - 530Introduction - Introduction to Scientific to Scientific Visualization Visualization - 08/27/2014 17 Shading Phong lighting model (1975) • Specular reflection • Diffuse reflection • Ambient reflection Light intensity per light source and per color channel I = ksIs + kdId + kaIa relative contributions (material specific) CS530CS - 530Introduction - Introduction to Scientific to Scientific Visualization Visualization - 08/27/2014 17 Shading Phong lighting model (1975) • Specular reflection • Diffuse reflection • Ambient reflection Light intensity per light source and per color channel I = ksIs + kdId + kaIa relative contributions (material specific) CS530CS - 530Introduction - Introduction to Scientific to Scientific Visualization Visualization - 08/27/2014 17 Shading Phong lighting model: Specular Reflection • mirror-like surfaces • Specular reflection depends on position of the observer relative to light source and surface normal ⇥n ⇥r ⇥l ⇥v θ θ γ CS530CS - 530Introduction - Introduction to Scientific to Scientific Visualization Visualization - 08/27/2014 18 Shading Phong lighting model: Specular Reflection n n Is = Ii cos γ = Ii cos < r,v> ⇥n ⇥r ⇥l ⇥v θ θ γ CS530CS - 530Introduction - Introduction to Scientific to Scientific Visualization Visualization - 08/27/2014 19 Shading Phong lighting model: Diffuse Reflection • Non-shiny surfaces • Diffuse reflection depends only on relative position of light source and surface normal. ⇥n ⇥ l θ CS530CS - 530Introduction - Introduction to Scientific to Scientific Visualization Visualization - 08/27/2014 20 Shading Phong lighting model: Diffuse Reflection Id = Ii cos ✓ = Ii (~l ~n) Id = Ii cos θ = Ii cos·< l,n> ⇥n ⇥ l θ CS530CS - 530Introduction - Introduction to Scientific to Scientific Visualization Visualization - 08/27/2014 21 Shading Phong lighting model per color channel N n I = kaIa + Ii (kd cos(✓)+ks cos (γ)) i=1 X ambient light sum over all light sources ⇥n ⇥r ⇥l ⇥v θ θ γ CS530CS - 530Introduction - Introduction to Scientific to Scientific Visualization Visualization - 08/27/2014 22 Shading Phong lighting model Ambient Diffuse Specular Phong Reflection http://en.wikipedia.org/wiki/Phong_shading CS530CS - 530Introduction - Introduction to Scientific to Scientific Visualization Visualization - 08/27/2014 Rasterization Rasterization • Putting shaded polygons on screen • Transform geometric primitives into pixels • Lowest level: scan conversion • Bresenham, midpoint algorithms CS530CS - 530Introduction - Introduction to Scientific to Scientific Visualization Visualization - 08/27/2014 Rasterization • Putting shaded polygons on screen • Transform geometric primitives into pixels • Lowest level: scan conversion • Bresenham, midpoint algorithms CS530CS - 530Introduction - Introduction to Scientific to Scientific Visualization Visualization - 08/27/2014 Rasterization • Putting shaded polygons on screen • Transform geometric primitives into pixels • Lowest level: scan conversion • Bresenham, midpoint algorithms CS530CS - 530Introduction - Introduction to Scientific to Scientific Visualization Visualization - 08/27/2014 Rasterization • Putting shaded polygons on screen • Transform geometric primitives into pixels • OpenGL (graphics library) takes care of such

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    71 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us