polygon meshes and other modeling tools n.
Download
Skip this Video
Loading SlideShow in 5 Seconds..
Polygon Meshes and other modeling tools PowerPoint Presentation
Download Presentation
Polygon Meshes and other modeling tools

Loading in 2 Seconds...

play fullscreen
1 / 37

Polygon Meshes and other modeling tools - PowerPoint PPT Presentation


  • 152 Views
  • Uploaded on

Polygon Meshes and other modeling tools. Object representation Polygon meshes Normals Scene graphs Level of detail Space partitioning. How can we represent objects/scenes. Polygon meshes Scene graphs Parametric representations Equations Bunch o points. Why?. Rendering Manipulate

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about 'Polygon Meshes and other modeling tools' - tobit


An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
polygon meshes and other modeling tools
Polygon Meshes and other modeling tools
  • Object representation
  • Polygon meshes
  • Normals
  • Scene graphs
  • Level of detail
  • Space partitioning
how can we represent objects scenes
How can we represent objects/scenes
  • Polygon meshes
  • Scene graphs
  • Parametric representations
  • Equations
  • Bunch o points
slide3
Why?
  • Rendering
  • Manipulate
    • User
    • System
point clouds
Point Clouds
  • Unstructured set of 3D point samples
    • Why
    • What for?
polygon triangle soup
Polygon/Triangle Soup
  • Unstructured set up polygons/triangles
    • Just a list of vertices for each polygon/triangle
    • Why?
    • What for?

class Triangle

{

public:

Triangle() {m_material = NULL;}

CGrPoint3F m_vertices[3];

CGrPoint3F m_normals[3];

CGrPoint2F m_tvertices[3];

const void *m_material;

};

what is tessellation
What is tessellation?
  • Representing a surface with flat approximating polygons
    • A sampled representation
  • Geometric Aliasing
    • Error in the representation due to the sampling with polygons
polygon triangle mesh
Polygon/Triangle mesh
  • Common method for describing geometry
  • Set of vertices
    • Coordinates
    • Normal
    • Texture coordinates
    • Etc.
  • Set of surfaces
    • Pointers to vertices
    • Material properties

Common: Triangle mesh

slide8

class CTriangleMesh

{

public:

CTriangleMesh(void);

~CTriangleMesh(void);

// This structure defines a triangle

struct Triangle {

int m[3];

const CMaterial *material;

};

int VertexCnt() const {return (int)m_vertices.size();}

int TriangleCnt() const {return (int)m_triangles.size();}

const std::vector<CGrPoint3F> &Vertices() const {return m_vertices;}

const std::vector<CGrPoint3F> &Normals() const {return m_normals;}

const std::vector<CGrPoint2F> &TVertices() const {return m_tvertices;}

const std::vector<Triangle> &Triangles() const {return m_triangles;}

const CMaterials &Materials() const {return m_materials;}

private:

CMaterials m_materials; // The materials collection

// The vertices, normals, and texture vertices.

// These three all correspond with each other.

std::vector<CGrPoint3F> m_vertices;

std::vector<CGrPoint3F> m_normals;

std::vector<CGrPoint2F> m_tvertices;

std::vector<Triangle> m_triangles;

};

polygon mesh
Polygon Mesh
  • Retains shared-vertex relationships

c

a

Vertex a,b,c,d;

Polygon P1(a, b, c);

Polygon P2(c, b, d);

d

b

b,c shared by two

polygons

computing a surface normal
Computing a surface normal
  • Assume the following polygon:

p3

p4

N

p2

p1

the method of projected areas
The Method of Projected Areas
  • Assume this 2D example line:

p1

dy

p2

dx

Projection of length

to one axis

method of projected areas
Method of Projected Areas
  • The projection of the area onto the x/y plane is the z part of the normal
where does this come from
Where does this come from?

y

x

Why would we want to use this?

vertex normals
Vertex normals
  • Add normals for surfaces incident on vertex:
the winged edge data structure
The Winged-Edge Data Structure
  • Maintains
    • List of vertices
    • List of edges
    • List of faces
winged edge data structure
Winged-Edge Data Structure

Vertex table:

Face table:

edge table
Edge Table

a

e

D

c

1

2

B

b

d

voxels
Voxels
  • Grid of volumetric samples
    • CAT, MRI, etc.
scene graphs
Scene Graphs

Composite

Separator

Separator

Separator

Translate

Translate

Translate

BarbellBar

BarbellEnds

Color

Color

Composite

Composite

Polygon

Polygon

Polygon

Polygon

collapsing a scene graph
Collapsing a Scene Graph
  • It’s often possible to apply transformations in a scene graph once to the underlying vertices, collapsing some nodes. Example:

Translation

Collapse to

Polygon

Rotation

Polygon

cloning
Cloning
  • If part of a scene graph has two edges to it, it will be necessary to clone before collapsing

Translation

Translation

Translation

Rotation

Rotation

Rotation

Polygon

Polygon’

Polygon

integration of meshes with scene graphs
Integration of mesheswith scene graphs

Composite

Separator

Separator

Separator

Translate

Translate

Translate

BarbellBar

BarbellEnds

Color

Color

Composite

Polygon Mesh

Other possibilities?

Polygon

Polygon

bounding boxes
Bounding Boxes
  • Bounding boxes describe the X,Y,Z extents (minimum and maximum values).
    • If we know everything below a certain point in the scene graph is in a box, we can avoid traversal if the box is not on-screen
slide25

class CBBoxF

{

public:

class CBBoxF() {};

class CBBoxF(const CGrPoint3F &p) : m_min(p), m_max(p) {}

void Set(const CGrPoint3F &p) {m_min = p; m_max = p;}

void Set(const CBBoxF &b) {m_min = b.m_min; m_max=b.m_max;}

void Include(const CGrPoint3F &p);

void Include(const CBBoxF &b) {Include(b.m_min); Include(b.m_max);}

const CGrPoint3F &Max() const {return m_max;}

const CGrPoint3F &Min() const {return m_min;}

const float MinForD(int d) const {return m_min[d];}

double Extent(int d) const {return m_max[d] - m_min[d];}

private:

CGrPoint3F m_min;

CGrPoint3F m_max;

};

levels of detail lod
Levels of Detail (lod)
  • Alternative scene graphs with different resolutions
    • Varying tessellation
    • Which we use depends on how far away the camera is.
    • Significant performance enhancement
bsp trees
BSP Trees
  • Binary Space Partitioning
    • Divides space into half-spaces
    • We can then use this method to
      • limit how much scene graph we examine
      • examine the scene graph in certain orders
k d trees
k-d Trees
  • k is dimensions
  • Node
    • Info
    • x, y
    • lt-link
    • ge-link
levels
Levels
  • Level 0 – Index X
    • Level 1 – Index Y
      • Level 2 – Index X
  • level = 0 if root, level(parent)+1 otherwise
  • For each level, index: level mod k
  • 3D: Index X, Index Y, Index Z, Index X, etc…
example
Example

Banja Luca (19, 45)

X

  • Banja Luca (19, 45)
  • Derventa (40, 50)
  • Teslic (38, 38)
  • Tuzla (54, 40)
  • Sinj (4, 4)

Sinj (4, 4)

Derventa (40, 50)

Y

Teslic (38, 38)

X

Tuzla (54, 40)

Y

Insert: East Broko (21, 57)

Search for exact?

Search for nearest?

Range searches?

k d trees1
k-d Trees
  • Search for exact
    • Okay, but may be o(k)
  • Search for nearest
    • In a moment
  • Range search?
range search
Range Search
  • Consider each tree level to be region
  • Recursively search all regions that overlap search range
example regions
Example Regions

(-,+) (-,+)

Banja Luca (19, 45)

(-,19) (-,+)

Sinj (4, 4)

Derventa (40, 50)

[19,+) (-,+)

[19,+) [50,+)

East Broko (21, 57)

Teslic (38, 38)

[19,+) (-,50)

Tuzla (54, 40)

[38,+) (-,50)

Range: (10,20) (20, 45)

k d trees2
k-d Trees
  • Fast and easy
  • Tend to be rather tall (unbalanced)
  • How could we extend to disk structure?
  • What if k=1?
quadtrees
Quadtrees
  • 2-d only
  • Split data 4 ways
  • Node:
    • info
    • x,y
    • nw,sw,ne,se
example1
Example

Banja Luca (19, 45)

  • Banja Luca (19, 45)
  • Derventa (40, 50)
  • Teslic (38, 38)
  • Tuzla (54, 40)
  • Sinj (4, 4)

nw

ne

se

Sinj (4, 4)

Derventa (40, 50)

Teslic (38, 38)

se

Tuzla (54, 40)

Insert: East Broko (21, 57)

Search for exact?

Search for nearest?

Range searches?

octtrees
Octtrees
  • 3-d
  • Split data 8 ways
  • Node:
    • info
    • x,y,z
    • up nw,sw,ne,se, down nw,sw,ne,se