2002 02 01 part 1
play

2002-02-01 - Part 1 Lecture 9: Scientific visualization Lecture - PowerPoint PPT Presentation

2002-02-01 - Part 1 Lecture 9: Scientific visualization Lecture 10: Scalar algorithms Textbook: Chapter 6.1 and 6.2 Extra: Article by Shen et.al. Exercises: 6.1, 6.2, 6.4, 6.5 Mats Nyl en February 1, 2002 Slide 1 of


  1. 2002-02-01 - Part 1 • Lecture 9: – Scientific visualization • Lecture 10: – Scalar algorithms • Textbook: Chapter 6.1 and 6.2 • Extra: Article by Shen et.al. • Exercises: 6.1, 6.2, 6.4, 6.5 Mats Nyl´ en February 1, 2002 Slide 1 of 31

  2. The visualization pipeline During earlier lectures we have talked about the first (i.e. the data) and the last (i.e. the rendering) part of the pipeline. Now we will start to talk about the middle part. Visulization algorithms Data Display Transform Mapping Interactive Feedback Mats Nyl´ en February 1, 2002 Slide 2 of 31

  3. Visualization in 1D and 2D Simple examples of visualization in 1D and 2D: • 1D: plotting a function f ( x ) • 2D: contour curves • 2D: plotting a vectorfield as directed lines (hedgehogs). Mats Nyl´ en February 1, 2002 Slide 3 of 31

  4. 1D example: f ( x ) 1 0.8 0.6 0.4 0.2 f ( x ) 0 -0.2 -0.4 -0.6 -0.8 -1 -10 -5 0 5 10 x Mats Nyl´ en February 1, 2002 Slide 4 of 31

  5. 2D contours Mats Nyl´ en February 1, 2002 Slide 5 of 31

  6. 2D hedgehogs Mats Nyl´ en February 1, 2002 Slide 6 of 31

  7. Visualization Roadmap Dimensionality of the representation Icons Volume Rendering Attribute 3 D Solids Modelling Mapping Height Fields Tiled Surfaces Pseudo Color Attribute Stacked Textures 2 D Contour Maps Mapping Ribbons Images 3D Vector Nets Contour Maps Lines Field Vectors Field Vectors 1 D Hedge Hogs Curves Space Curves Ribbons Scatter Plots Scatter Plots Points Particles Particle Tracers 0 D Dot Lines Dot Surfaces 1 D 2 D 3 D nD Dimensionality of the computational domain Mats Nyl´ en February 1, 2002 Slide 7 of 31

  8. Visualization techniques Let’s go back to the visualization pipeline again Visulization algorithms Data Display Transform Mapping Interactive Feedback Mats Nyl´ en February 1, 2002 Slide 8 of 31

  9. Transformations The first part is about transformation • Geometric transformations, for example scaling the coordinates. • Topological transformations, for example converting a dataset from polygonal data to unstructured grid data. • Attribute transformations, for example standard vector analysis on the field. • Combined transformations, transformations which affects both the topol- ogy and the attributes. Mats Nyl´ en February 1, 2002 Slide 9 of 31

  10. Algorithms The second part is about mapping the data to something that can be visualized (i.e. some 3D model) • Scalar algorithms works on scalar data, for example generating contour lines or isosurfaces. • Vector algorithms works on vector data. Showing oriented arrows is an example of vector visualization. • Tensor algorithms works with tensors. • Modelling algorithms generates dataset topology or geometry, or sur- face normals or texture data. For example, generating glyphs oriented according to the vector direction and then scaled according to the scalar value is a combined vector/scalar algorithm. Mats Nyl´ en February 1, 2002 Slide 10 of 31

  11. Scalar algorithms The most elementary algorithms deals with scalar data or data that can be made into scalar • Color mapping: map the scalar to a color, and then display that color. The scalar mapping is implemented using a color lookup table, that is indexed with the scalar. Good choice of the “transfer function” is important for the final result of the visualization. contouring is a natural idea for scalars, in 2D we get • Contouring: contour lines (like the elevation curves on a map), wheras in 3D we get isosurfaces . • Scalar generation: since scalar visualization techiniques are simple and effective methods, we might wish to use these techniques even when visualizing something that isn’t a scalar field. Then we need to generate a scalar. Mats Nyl´ en February 1, 2002 Slide 11 of 31

  12. Color mapping - grayscales The simplest type of colour map is simply a gray scale where white represent the minimum value and black the maximum (or vice versa). Mats Nyl´ en February 1, 2002 Slide 12 of 31

  13. Grayscale example Mats Nyl´ en February 1, 2002 Slide 13 of 31

  14. Color mapping - continuous We could also use a continous range of colors. Mats Nyl´ en February 1, 2002 Slide 14 of 31

  15. Rainbow example - blue to red Mats Nyl´ en February 1, 2002 Slide 15 of 31

  16. Rainbow example - red to blue Mats Nyl´ en February 1, 2002 Slide 16 of 31

  17. Color mapping - discontinuous When the transition of special values are important we could use disconti- nous scales. Mats Nyl´ en February 1, 2002 Slide 17 of 31

  18. Contrast example Mats Nyl´ en February 1, 2002 Slide 18 of 31

  19. Contouring Useful scalar technique: • Gives contour-curves in 2D • Gives iso-surfaces in 3D Main algorithm is Marching Cubes Mats Nyl´ en February 1, 2002 Slide 19 of 31

  20. Marching Cube - The Problem Extracting the iso-surface from an implicit function, i.e., extracting a sur- face from volume data by solving f ( x, y, z ) = T . 6 6 7 6 6 7 9 9 8 7 8 9 10 9 8 8 9 9 8 7 6 6 7 6 6 T = 8 . 5 T = 7 Mats Nyl´ en February 1, 2002 Slide 20 of 31

  21. Marching Cube Algorithm from Lorensen and Cline 1987: • Treat each cube individually • Allow intersections only on the edges or at vertices • Pre-calculate all of the necessary information to construct a surface Mats Nyl´ en February 1, 2002 Slide 21 of 31

  22. Marching Cube - Summary • Create a cube • Classify each voxel • Build an index • Lookup edge list • Interpolate triangle vertices • Calculate and interpolate normals Mats Nyl´ en February 1, 2002 Slide 22 of 31

  23. Using iso-surfaces One use of iso-surfaces is to animate the iso-value Mats Nyl´ en February 1, 2002 Slide 23 of 31

  24. Contouring is ambiguous In both 2D and 3D contouring is ambiguous. Mats Nyl´ en February 1, 2002 Slide 24 of 31

  25. Ambiguity in 3D OR? Leads to holes! Mats Nyl´ en February 1, 2002 Slide 25 of 31

  26. Marching Cubes is simple /* Determine the marching cubes index */ for ( i= 0, index = 0; i < 8; i++) { if (val1[ nodes[ i]] >= thresh) /* If the nodal value is above the */ index |= CASE_ MASK[ i]; /* threshold, set the appropriate bit. */ triCase = HexaTriCases + index; /* triCase indexes into the MC table. */ edge = triCase->HexaEdges; /* edge points to the list of intersected edges */ for ( ; edge[ 0] > -1; edge += 3 ) { for (i= 0; i< 3; i++) /* Calculate and store the three edge intersections */ { vert = HexaEdges[ edge[ i]]; n0 = nodes[ vert[ 0]]; n1 = nodes[ vert[ 1]]; t = (thresh - val1[ n0]) / (val1[ n1] - val1[ n0]); tri_ ptr[ i] = add_ intersection( n0, n1, t ); /* Save an index to the pt. */ } add_ triangle( tri_ ptr[ 0], tri_ ptr[ 1], tri_ ptr[ 2], zoneID ); /* Store the triangle */ } } Mats Nyl´ en February 1, 2002 Slide 26 of 31

  27. Marching cubes - datastructures static int const HexaEdges[ 12][ 2] = { {0, 1}, {1, 2}, {2, 3}, {3, 0}, {4, 5}, {5, 6}, {6, 7}, {7, 4}, {0, 4}, {1, 5}, {3, 7}, {2, 6}}; typedef struct { EDGE_ LIST HexaEdges[ 16]; } HEXA_ TRIANGLE_ CASES; /* Edges to intersect. Three at a time form a triangle. */ static const HEXA_ TRIANGLE_ CASES HexaTriCases[] = { {- 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, /* 0 */ { 0, 8, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, /* 1 */ { 0, 1, 9, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, /* 2 */ { 1, 8, 3, 9, 8, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, /* 3 */ ... Mats Nyl´ en February 1, 2002 Slide 27 of 31

  28. Efficient searching For large datasets it becomes very inefficient to search all voxels for the surface. A better way is in the paper by Shen et.al. Isosurfacing in span space with utmost efficiency (ISSUE) Mats Nyl´ en February 1, 2002 Slide 28 of 31

  29. Span space We need only search the voxels that are within the shaded region! Max T Min T Mats Nyl´ en February 1, 2002 Slide 29 of 31

  30. Scalar generation s i = ( p i − p l ) · ( p h − p l ) | p h − p l | 2 Mats Nyl´ en February 1, 2002 Slide 30 of 31

  31. Summary and outlook • Visualization is about discovery not presentation. • Scalar algorithms has an appealing simplicity. • Marching cubes can be made efficient • Next tuesday we will work through the rest of chapter 6. – Vector algorithms – Algorithms of special interest in computational fluid dynamics (CFD). • Next lecture is an introduction to vector fields and flows. Mats Nyl´ en February 1, 2002 Slide 31 of 31

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend