Top Banner
Virtual models and Data Structures Ing. Andrés Adolfo Navarro Newball, MSc, PhD Senior Lecturer and Researcher Pontificia Universidad Javeriana, Cali, Colombia
35
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Graphics' Data Structures

Virtual modelsand Data StructuresIng. Andrés Adolfo Navarro Newball, MSc, PhD

Senior Lecturer and ResearcherPontificia Universidad Javeriana, Cali, Colombia

Page 2: Graphics' Data Structures

Point

Computer Science Department, Pontificia Universidad Javeriana, Cali

Z

X

Y

(x, y, z)

Page 3: Graphics' Data Structures

Line

Computer Science Department, Pontificia Universidad Javeriana, Cali

(x2, y2, z2)

Z

X

Y

(x1, y1, z1)

Page 4: Graphics' Data Structures

Polygon

Computer Science Department, Pontificia Universidad Javeriana, Cali

(x2, y2, z2)

Z

X

Y

(x1, y1, z1)

(x3, y3, z3)

Page 5: Graphics' Data Structures

Mesh

Computer Science Department, Pontificia Universidad Javeriana,

Cali

Page 6: Graphics' Data Structures

Creación de mallas Technique Description Advantages DisadvantagesStraightforward modelling

Pulling vertices around To generate new sets of polygons means reactivating whatever modelling procedure was used to create the original polygons

TediousNot very useful in practice

3D digitiser or equivalent manual strategy

Convert real objects into polygon meshes. Manual strategy: drawing a net of vertices over the surface of the object. The vertices are defined where net lines intersectDigitiser: the 3D coordinates of the vertices are input using a 3D digitiser

Automatic device such as laser ranger

Convert real objects into polygon meshes. The object is placed in a rotating table in the path of the bean and the table also moves down and up.A skinning algorithm operates on pairs of obtained contours converts data into very large number of triangles.

They generate a big number of triangles.As concavities may not be hit by the bean, they can only model convex objects accurately.

From mathematical description (procedural)

Generate a model from definitions with mathematical formulas.

Sweeping Generate model from definitions with interaction curves defined mathematically. For example, using cross sections or rail product surfaces

Only real option with user interaction

Page 7: Graphics' Data Structures

Estructuras de datos para mallas Dos puntos de vista

Como se almacenan en disco? Formatos comunes

Estructura de datos en memoria

Page 8: Graphics' Data Structures

Formatos comunes“The data structure for a complex object can’t be written by

hand. There are a lot of programs that help to create 3D meshes in a very quick way” (Vitulli (2005))

De alguna manera todos deben indicar como crear unir puntos con líneas para crear el poliedro (malla)

3DS .X FBX WRL obj

Page 9: Graphics' Data Structures

3DS A series of blocks called chunks which

contain all the information necessary to describe a scene

The name of the object, the vertices coordinates and the list of polygons

Chunks are dependent on others creating a tree structure and their relative parents have to be read first

Only the chunks required by the user or application have to be read

Page 10: Graphics' Data Structures

Main Chunk

3D Editor chunk

Object block Material block Key framer

Triangular mesh

Vertices list

Faces description

Local coordinates

Mapping coordinates

Camera

Light

Page 11: Graphics' Data Structures
Page 12: Graphics' Data Structures

.X Formato de Direct X utilizado por direct

3D Describe geometría, jerarquías de

cuadros, animaciones

Page 13: Graphics' Data Structures
Page 14: Graphics' Data Structures

FBX Formato de Autodesk para intercambiar

3D entre varios de sus productos Especificación de un SDK para

desarrolladores

Page 15: Graphics' Data Structures
Page 16: Graphics' Data Structures

WRL Mi favorito por su simpleza Formato de VRML

Page 17: Graphics' Data Structures
Page 18: Graphics' Data Structures

Representación de objetos We needed an adequate method to represent

the surface of a 3D object A surface separates the interior from the

exterior by a boundary To generate a mathematical surface we need

to establish continuity and neighbourhood relationships between samples

These representations are just approximations In order to decrease the error one can use

more segments or sub-regions.

Page 19: Graphics' Data Structures

Representación de objetos Operations required:

Evaluation: sampling of the surface and its attributes

Query: identify if a given point is inside or outside

Modification: surface deformations or topology changes

Page 20: Graphics' Data Structures

Representación de objetos Paramétrica:

Vector valued parameterisation function Mejores para evaluación y modificación

Implícita Zero set of a scalar valued function Mejores para query

Page 21: Graphics' Data Structures

Mallas poligonales Approximate a surface by a mesh of

planar polygonal facets Low complexity representations more

efficient for rendering Triangular meshes remain the most

used structure for 3D modelling Generación paramétrica Sopa de triángulos

Page 22: Graphics' Data Structures

Mallas triangulares Frequently, coarse collection without a

mathematical representation Little connectivity information (triangle

soups), inconsistent normal orientations, gaps, intersecting patches and degenerate elements

Page 23: Graphics' Data Structures

Mallas triangulares The valence of a vertex is the number of vertices

in its neighbourhood. In semi-regular triangular meshes, most of the

vertices have a valence of 6 Extraordinary vertices: vertices with a different

valence A triangle mesh is two-manifold, if it does neither

contain non-manifold edges or nonmanifold vertices, nor self-intersections

A non-manifold edge has more than two incident triangles

Page 24: Graphics' Data Structures

Triangle strips Triangle strips increase code efficiency. After the

first triangle is defined using three vertices, each new triangle can be defined by only one additional vertex, sharing the last two vertices defined for the previous triangle.

Triangle strips reduce the amount of data needed to create a series of triangles. The number of vertices stored in memory is reduced from 3N to N+2, where N is the number of triangles to be drawn. This allows for less use of disk space, as well as making them faster to load into RAM.

Computer Science Department, Pontificia Universidad Javeriana,

Cali

Page 25: Graphics' Data Structures

Triangle strips ABC, CBD, CDE, and EDF. However, using a triangle strip, they can be

stored simply as a sequence of vertices ABCDEF.

Computer Science Department, Pontificia Universidad Javeriana,

Cali

Page 26: Graphics' Data Structures

Estructuras de datos La solución simple

Arreglos Un arreglo de coordenadas Un arreglo de uniones

Efficient data structures allow local and global traversal of a mesh. Operations include: Access and enumeration of individual vertices, edges,

faces. Oriented traversal of edges of a face (next edge in a

face). Access to at least one face attached to a given vertex.

Page 27: Graphics' Data Structures

Lista enlazada Alan Watt

Jerarquía objeto – superficie – polígono Detalles de los vértices se almacenan una

vez polígonos pueden compartir el mismo

vértice a menos que los vértices sean compartidos por dos superficies

Almacena normales de polígonos y vértices

Page 28: Graphics' Data Structures

Lista enlazada Escena:

Lista de objetos Un objeto esta construido por una lista de

superficies Cada superficie se representa con una malla

poligonal Un polígono se define con una serie de vértices

definidos en sentido contrario de las manecillas del reloj. Orden requerido para la normal

Los detalles de cada vértice se almacenan en una lista del objeto. Accesibles al tope

Page 29: Graphics' Data Structures

Lista enlazada

Page 30: Graphics' Data Structures

Halfedge data structure

Page 31: Graphics' Data Structures

Direct edges Most efficient to deal with triangular

meshes Based on indices as references to each

element where indexing follows rules that implicitly encode connectivity information

No explicit representation of edges

Page 32: Graphics' Data Structures

Direct edges Each edge is represented into two

opposing halfedges consistently oriented counter clockwise

Page 33: Graphics' Data Structures

Direct edges

Page 34: Graphics' Data Structures

Direct edges Groups the three halfedges belonging to a

common triangle Additional information is explicitly stored in

arrays. For each vertex, the index of an outgoing

halfedge is stored For each halfedge, the index of its opposite half

edge and the index of the vertex the halfedge points to are stored

Boundaries are managed with special negative indices

Page 35: Graphics' Data Structures

Referencias Paul Bourke. Data formats

http://local.wasp.uwa.edu.au/~pbourke/dataformats/ Vitulli, D. (2005). Spacesimulator.net.

http://www.spacesimulator.net/. 3D Computer Graphics. Alan Watt Botsch M., Pauly M., Kobbelt, L., Alliez P., Lévy B.

Geometric Modeling Based on Polygonal Meshes. SIGRAPH Courses, 2007

Navarro Newball, A. A., Wyvill, G., and McCane, B. (2008a). Efficient Mesh Generation

Using Subdivision Surfaces. Sistemas & Telem´atica, 6 (12), 111–126.