7. 8.3. Modellierung von Punktewolken 8.3.4. Programmierung […] #define M 4 //Größe des Objekts #define ABSTAND 0.1 //Abstand der Einzelpunkte //Zeichne Punkte glBegin(GL_POINT); { intx,y,z; for(int i=0; i<100; i++) { // pro Durchgang: erhöhe den Tiefenwert; Baue Objekt erst Spalten- // dann Zeilenweise auf. z=i%M; x=((int)(i/M))%(M*M); y=(int)(i/(M*M)); // Setze Farbwert glColor4f(0.0f, 0.12f, 0.75f, 0.8f); // Setze Position glVertex3f(ABSTAND*x, ABSTAND*y, ABSTAND*z); } } glEnd(); […] Vorteil: Bewegung in das Objekt möglich
8.
9. 8.3. Mathematic Modelling of Objects 8.3.6. Conversion point cloud – polygonial net (Meshing) First approach for conversion: Triangulation (triangle construction) Graham-Algorithmus 2-dimensional: detect point with lowest y-value Afterwards: connection of the other points depending on the angle to seed point, beginning with the lowest interconnect environment points according to angle order
10. 8.3. Mathematic Modelling of Objects 8.3.6. Conversion point cloud – polygonial net (Meshing) Last step: delete concave corner points
11. 8.3. Mathematic Modelling of Objects 8.3.6. Conversion point cloud – polygonial net (Meshing) Second approach: construction of polygon according to human thinking Two-Peasant – Graphs Detection of points with x-maximum and x-minimum seperation of cloud in upper and lower half order halfs interconnection of sequential points of upper half from min(x) to max(x) Interconnection of sequential points of lower half from max(x) to min(x)
12. 8.3. Modellierung von Punktewolken 8.3.6. Umwandlung Punktewolke - Dreiecksnetz Übergang 2D-3D: Mustererkennung Anwendbar bei Wissen über geometrische Zusammensetzung der Szene (Beispiel: Billard-Tisch) Vergleich einzelner Punktehaufen mit mathematischer Objektbeschreibung Objekt modellieren wenn genügende Anzahl (Schwellwert) an Punkte auf Objektbeschreibung zutrifft Billard: Kugel definiert durch Mittelpunkt und Radius x−x02+y−y02+ z−z02= r2
13. 8.3. Modellierung von Punktewolken 8.3.6. Umwandlung Punktewolke - Dreiecksnetz Suche von Minimum- und Maximum-Punkt für x-, y- und z-Werte Verbindung der Punkte; Halbierung der Strecken; Mittelwerte der Beträge halben Strecken mgl. Radius P0= xPxMin+xPxMax−xPxMin2zPyMin+yPyMax−yPyMin2zPzMin+zPzMax−zPzMin2 Test nach genannter Formel, ob Oberflächenpunkte zu Kugel zugehörig
14. 8.3. Mathematic Modelling of Objects 8.3.6. Conversion point cloud – polygonial net (Meshing) Last presentedpossiblity: 3D-facettes byMarching Cubes weightingofcornerpoints Constructionofweightedvoxels Check per voxel: cornersexceedingcertainthreshold; indexcontatenationofincludingcorners check Look-Up Table forpolygonconfiguration compositionofvoxel-cuberesultstooneobjects facettenormalscanbesaved inLook-Up Table too
29. 8.4. Constructive Solid Geometry (CSG) 8.4.4. boolean object combination Union: united set of objects objects are into each other Difference: all points of a basic object, which are not included in the combined object Intersection: Points, included in all combined objects