Virtuelle Realität und Simulation - Übung 2
Blatt 6
Prof. Dr. Gabriel Zachmann (zach@in.tu-clausthal.de) David Mainzer (dm@tu-clausthal.de)
Institut für Informatik
2. Februar 2009
Gliederung
Ergänzung Aufgabenzettel 5 Punkt in Polyeder
Algorithmus Framework
Übungsblatt 6
Gliederung
Ergänzung Aufgabenzettel 5 Punkt in Polyeder
Algorithmus Framework
Übungsblatt 6
Gedanke bei Punkt in Polyeder
Ziel: Feststellung ob Punkt vom Tuch im Inneren vom Achterbahnwagon
– Testet man umgekehrt, ist Wahrscheinlichkeit eines Fehlers höher
– Aber auch hier kann es sein, dass Kollisionen übersehen werden
Wie läuft der Test nun ab?
Algorithmus – Joseph O’Rourke
Algorithm 1: POINT IN POLYHEDRON
Compute bounding r a d i u s R.
while ( TRUE )
r0= random r a y o f l e n g t hR r=q+r0
crossings=0
f o r each t r i a n g l e T o f polyhedron Pdo SegTriInt(T q r).
i f degenerate i n t e r s e c t i o n then go to begin o f loop
e l s e Increment crossings a p p r o p r i a t e l y . i f crossingsodd
then q i s i n s i d e P e l s e q i s o u t s i d e P E x i t .