18
Triangulation of Implicit Surfaces 3D Graphics Systems Pablo J. Antuna June 26, 2015

Triangulation of Implicit Surfacesw3.impa.br/~pabloant/s3d/slides.pdf · Modeling: Triangulation Detailes about the 3D case I We have 256 possible cases. I Discarding the trivial

  • Upload
    others

  • View
    3

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Triangulation of Implicit Surfacesw3.impa.br/~pabloant/s3d/slides.pdf · Modeling: Triangulation Detailes about the 3D case I We have 256 possible cases. I Discarding the trivial

Triangulation of Implicit Surfaces3D Graphics Systems

Pablo J. Antuna

June 26, 2015

Page 2: Triangulation of Implicit Surfacesw3.impa.br/~pabloant/s3d/slides.pdf · Modeling: Triangulation Detailes about the 3D case I We have 256 possible cases. I Discarding the trivial

Parts of the project

I Modeling

I Visualization

I Interface

Page 3: Triangulation of Implicit Surfacesw3.impa.br/~pabloant/s3d/slides.pdf · Modeling: Triangulation Detailes about the 3D case I We have 256 possible cases. I Discarding the trivial

Modeling: Implicit Surfaces

Mathematical implicit surfaces:

f (x , y , z) = 0.

Example:x2 + y2 + z2 − R2 = 0.

Page 4: Triangulation of Implicit Surfacesw3.impa.br/~pabloant/s3d/slides.pdf · Modeling: Triangulation Detailes about the 3D case I We have 256 possible cases. I Discarding the trivial

Modeling: Triangulation

How do we visualize implicit surfaces?Two ideas:

I Ray Tracing

I Triangulation

Page 5: Triangulation of Implicit Surfacesw3.impa.br/~pabloant/s3d/slides.pdf · Modeling: Triangulation Detailes about the 3D case I We have 256 possible cases. I Discarding the trivial

Modeling: Triangulation

Marching cubes algorithm:

I Easy to implement

I It is fast, because it is based on lookup tables

I The result can be rendered easily on the GPU

I Used for the visualization of medical data

Page 6: Triangulation of Implicit Surfacesw3.impa.br/~pabloant/s3d/slides.pdf · Modeling: Triangulation Detailes about the 3D case I We have 256 possible cases. I Discarding the trivial

Modeling: Triangulation

Algorithm:

I Create a uniform grid of cubes

I March through the grid: for each square, calculate the sign ofthe function at the vertices

I Lookup the corresponding intersections from a table

Example: Marching Squares

Page 7: Triangulation of Implicit Surfacesw3.impa.br/~pabloant/s3d/slides.pdf · Modeling: Triangulation Detailes about the 3D case I We have 256 possible cases. I Discarding the trivial

Modeling: Triangulation

Application: Simulation of Fluids

Page 8: Triangulation of Implicit Surfacesw3.impa.br/~pabloant/s3d/slides.pdf · Modeling: Triangulation Detailes about the 3D case I We have 256 possible cases. I Discarding the trivial

Modeling: Triangulation

Detailes about the 3D case

I We have 256 possible cases.

I Discarding the trivial cases, and using symetry, we can reduceit to 15 cases.

I An 8 bit index is formed where each bit corresponds to avertex.

Page 9: Triangulation of Implicit Surfacesw3.impa.br/~pabloant/s3d/slides.pdf · Modeling: Triangulation Detailes about the 3D case I We have 256 possible cases. I Discarding the trivial

Visualization

After the marching cubes algorithms is run, the result is a mesh oftriangles. Then,

I A scene file is created with the mesh as the only object in thescene

I Render the scene using S3D software and OpenGL

Page 10: Triangulation of Implicit Surfacesw3.impa.br/~pabloant/s3d/slides.pdf · Modeling: Triangulation Detailes about the 3D case I We have 256 possible cases. I Discarding the trivial

Interface

Features:

I Input for the mathematical expression

I Resolution input

I Arcball control of camera

I Field of view control (zoom)

Page 11: Triangulation of Implicit Surfacesw3.impa.br/~pabloant/s3d/slides.pdf · Modeling: Triangulation Detailes about the 3D case I We have 256 possible cases. I Discarding the trivial

Interface

Page 12: Triangulation of Implicit Surfacesw3.impa.br/~pabloant/s3d/slides.pdf · Modeling: Triangulation Detailes about the 3D case I We have 256 possible cases. I Discarding the trivial

Interface

Technical details:

I Developed in C/C++, interface designed with Qt Creator

I C++ Math Expression Parser (ExprTK)

Page 13: Triangulation of Implicit Surfacesw3.impa.br/~pabloant/s3d/slides.pdf · Modeling: Triangulation Detailes about the 3D case I We have 256 possible cases. I Discarding the trivial

Some Surfaces

Figure : Decocube, ((x2 + y2 − 0.22)2 + (z2 − 1)2) ∗ ((y2 + z2 − 0.22)2 +(x2 − 1)2) ∗ ((z2 + x2 − 0.22)2 + (y2 − 1)2) − 0.5 = 0.

Page 14: Triangulation of Implicit Surfacesw3.impa.br/~pabloant/s3d/slides.pdf · Modeling: Triangulation Detailes about the 3D case I We have 256 possible cases. I Discarding the trivial

Some Surfaces

Figure : Eight.

Page 15: Triangulation of Implicit Surfacesw3.impa.br/~pabloant/s3d/slides.pdf · Modeling: Triangulation Detailes about the 3D case I We have 256 possible cases. I Discarding the trivial

Some Surfaces

Figure : Chair.

Page 16: Triangulation of Implicit Surfacesw3.impa.br/~pabloant/s3d/slides.pdf · Modeling: Triangulation Detailes about the 3D case I We have 256 possible cases. I Discarding the trivial

Some Surfaces

Figure : Klein Bottle (Immersion), (x2 + y2 + z2 + 2y − 1) ∗ [(x2 + y2 +z2 − 2 ∗ y − 1)2 − 8 ∗ z2] + 16 ∗ x ∗ z ∗ (x2 + y2 + z2 − 2 ∗ y − 1) = 0.

Page 17: Triangulation of Implicit Surfacesw3.impa.br/~pabloant/s3d/slides.pdf · Modeling: Triangulation Detailes about the 3D case I We have 256 possible cases. I Discarding the trivial

Some Surfaces

Figure : Klein Bottle from another angle.

Page 18: Triangulation of Implicit Surfacesw3.impa.br/~pabloant/s3d/slides.pdf · Modeling: Triangulation Detailes about the 3D case I We have 256 possible cases. I Discarding the trivial

Thank you!