Non solo mesh
• Non di sole mesh vive la CG
M a r c o T a r i n i ‧ C o m p u t e r G r a p h i c s ‧ 2 0 1 4 / 1 5 ‧ U n i v e r s i t à d e l l ’ I n s u b r i a
Height Map
• Or: Height Field
• Or: 2.5 Dataset
•
M a r c o T a r i n i ‧ C o m p u t e r G r a p h i c s ‧ 2 0 1 4 / 1 5 ‧ U n i v e r s i t à d e l l ’ I n s u b r i a
float[resX][resY] heightMap;
Height Map
M a r c o T a r i n i ‧ C o m p u t e r G r a p h i c s ‧ 2 0 1 4 / 1 5 ‧ U n i v e r s i t à d e l l ’ I n s u b r i a
Gray-scale image, interpreted as a height map
Curisosità: physical height maps
M a r c o T a r i n i ‧ C o m p u t e r G r a p h i c s ‧ 2 0 1 4 / 1 5 ‧ U n i v e r s i t à d e l l ’ I n s u b r i a (CGI)
(CGI)
(real)
(real)
M a r c o T a r i n i ‧ C o m p u t e r G r a p h i c s ‧ 2 0 1 4 / 1 5 ‧ U n i v e r s i t à d e l l ’ I n s u b r i a
Height Map: rendering rasterization based
Height Field Triangle mesh
M a r c o T a r i n i ‧ C o m p u t e r G r a p h i c s ‧ 2 0 1 4 / 1 5 ‧ U n i v e r s i t à d e l l ’ I n s u b r i a
Esempio
• un esempio tipico:
– campo d'altezza per modellare un terreno...
Point Clouds
• Mesh… senza connettività
• Output «raw» di molti device e tecniche – computer vision,
– stereo matching…
• Spesso, bassa qualità
– rumore, – campionamento
disomogeneo
M a r c o T a r i n i ‧ C o m p u t e r G r a p h i c s ‧ 2 0 1 4 / 1 5 ‧ U n i v e r s i t à d e l l ’ I n s u b r i a M a r c o T a r i n i ‧ C o m p u t e r G r a p h i c s ‧ 2 0 1 4 / 1 5 ‧ U n i v e r s i t à d e l l ’ I n s u b r i a
Da Nuvola di punti a Triangle Mesh
nuvola di punti ?
( point cloud ) triangoli!
problema abbastanza studiato, (non facile)
Algoritmi comuni: “Ball Pivoting”, “Front Advancing”
x
y z
x
y z
M a r c o T a r i n i ‧ C o m p u t e r G r a p h i c s ‧ 2 0 1 4 / 1 5 ‧ U n i v e r s i t à d e l l ’ I n s u b r i a
Esempio Strutture Volumetriche ad elementi finiti
• Elementi finiti (volumetrici):
– voxels (“cubes”)
– hexahedrons (“cuboid”) – tetrahedrons
• 3D models can be
– voxelized (voxel grid),
– hexahedrized (hexahedron mesh) – tetrahedrized (tetrahedron mesh)
Voxels
• “Voxel” = Volume element – Così come…
• “Pixel” = Picture Element
• “Texel” = Texture Element
• Elemento griglia regolare 3D
• Esempio code:
array[resX][resY][resZ] of Voxels;
• File formats
– DICOM (medicina)
Voxels
Voxels: non solo 1 o 0
M a r c o T a r i n i ‧ C o m p u t e r G r a p h i c s ‧ 2 0 1 4 / 1 5 ‧ U n i v e r s i t à d e l l ’ I n s u b r i a
Dataset Volumetrico:
- griglia 3D regolare di valori di densità - campionamento regolare in 3D - es: output di una scansione TAC - es in C:
densità: 0.3 densità: 0.45 densità: 0.74
float volume[RES_X] [RES_Y] [RES_Z]
consumo memoria cubico con la risoluzione (diventa facilmente
ingestibile)
Voxelized volumes
• Output naturale di CT scans
(ogni voxel, un valore di densit
Voxelized volumes
Voxelization
Marching cubes, Dual Countoring
Voxelized volumes
• Varie
risoluzioni
Passare da volume a superficie
M a r c o T a r i n i ‧ C o m p u t e r G r a p h i c s ‧ 2 0 1 4 / 1 5 ‧ U n i v e r s i t à d e l l ’ I n s u b r i a
Dataset Volumetrico:
- griglia 3D regolare di valori di densità - campionamento regolare in 3D - es: output di una scansione TAC - es in C:
densità: 0.3 densità: 0.45
…
float volume[RES_X] [RES_Y] [RES_Z]
consumo memoria cubico con la risoluzione (diventa facilmente
ingestibile)
Passare da volume a superficie
M a r c o T a r i n i ‧ C o m p u t e r G r a p h i c s ‧ 2 0 1 4 / 1 5 ‧ U n i v e r s i t à d e l l ’ I n s u b r i a
Dataset Volumetrico V
algoritmo
“Marching- Cubes”
Iso-superficie Triangolata
(di valore s) S
• s = valore soglia
• superficie (chiusa) dove il valore del campo = s
• racchiude i punti di V che hanno valore > s
M a r c o T a r i n i ‧ C o m p u t e r G r a p h i c s ‧ 2 0 1 4 / 1 5 ‧ U n i v e r s i t à d e l l ’ I n s u b r i a M a r c o T a r i n i ‧ C o m p u t e r G r a p h i c s ‧ 2 0 1 4 / 1 5 ‧ U n i v e r s i t à d e l l ’ I n s u b r i a
Algorimo Marching-Cubes : alcuni cenni
M a r c o T a r i n i ‧ C o m p u t e r G r a p h i c s ‧ 2 0 1 4 / 1 5 ‧ U n i v e r s i t à d e l l ’ I n s u b r i a
Cubetto con vertici in 2 x 2 x 2 = 8 campioni del dataset
Ogni campione : - o dentro (se >s) - o fuori (se <s)
Per ciascuna combinazione di dentro/fuori
=> una triangolaione predefinita
(usare una tabella tabella, 2^8 = 256 casi) (ma solo 15 diversi contando le simmetrie)
Voxelized Volumes:
• Input naturale dei 3D printing devices
3D printer Tri Mesh
Voxelized volume
(ogni voxel, 1 bit: pieno/vuoto)
oggetto/i fisico/
Voxelized Volumes:
• Input naturale dei 3D printing devices
Modelli 3D per simulazioni fisiche accurate
• FEM / FEA
– Finite Element Method / Finite Element Analysis – Simulaz strutturale accurata
• distribuzione carichi
• Volume voxelizzato = struttura regolare
– come dire, “quadretti, ma in in 3D”
• Volume di tetraedri / hexaedri
= equivalente volumetrico
delle tri / quad meshes.
Tetrahedralization Tetrahedralization
M a r c o T a r i n i ‧ C o m p u t e r G r a p h i c s ‧ 2 0 1 4 / 1 5 ‧ U n i v e r s i t à d e l l ’ I n s u b r i a