prev up next

Szene-Baum auf nötiges reduzieren

Sobald der Baum vollständig aufgebaut ist wird rekursiv von der Wurzel aus jedem Knoten befohlen seine Kinder auf die zu reduzieren, die wir verarbeiten können wollen, dabei wird jedes allgemeine X3DObject-Objekt in ein speziallisiertes X3DObject-Objekt umgewandelt.

X3D Typ X3DObject Typ Entsprechung in unserem Programm
Box X3DBox Cube
    mit Skalierungsmatrix
Cone X3DCone keine
Coordinate X3DCoordinate Koordinaten eines Shape
Cylinder X3DCylinder Cylinder
Group X3DGroup Scene
IndexedFaceSet X3DIndexedFaceSet Shape
Scene X3DScene Scene
Shape X3DShape Shape
Spere X3DSpere Spere
Transform X3DTransform Matrix zwischen MC und WC
    noch nicht implementiert
Viewpoint X3DViewpoint Camera in View
X3D X3DRoot keine
    Wurzel des Baums

Hier eine Ausgabe des reduzierten X3DBaums:

java -cp ../..:org.apache.jar cgp.reader.X3DReader pyramid.x3d
Dokumentanfang
Dokumentende
Name: X3D      Attributzahl: 1      Kinderzahl: 1
  Attribute: version      Wert: 3.0
ROOT

Name: Scene      Attributzahl: 2      Kinderzahl: 2      Vater: X3D
  Attribute: containerField      Wert: 
  Attribute: class      Wert: 
SCENE

Name: Viewpoint      Attributzahl: 11      Kinderzahl: 0      Vater: Scene
  Attribute: description      Wert: Pyramid
  Attribute: orientation      Wert: 0 1 0 .2
  Attribute: position      Wert: 4 0 25
  Attribute: fieldOfView      Wert: 0.785398
  Attribute: jump      Wert: true
  Attribute: bind      Wert: false
  Attribute: bindTime      Wert: -1
  Attribute: isBound      Wert: false
  Attribute: centerOfRotation      Wert: 0 0 0
  Attribute: containerField      Wert: children
  Attribute: class      Wert: 
VIEWPOINT

Name: Transform      Attributzahl: 9      Kinderzahl: 1      Vater: Scene
  Attribute: translation      Wert: 0 -5 0
  Attribute: center      Wert: 0 0 0
  Attribute: rotation      Wert: 0 0 1 0
  Attribute: scale      Wert: 1 1 1
  Attribute: scaleOrientation      Wert: 0 0 1 0
  Attribute: bboxCenter      Wert: 0 0 0
  Attribute: bboxSize      Wert: -1 -1 -1
  Attribute: containerField      Wert: children
  Attribute: class      Wert: 
TRANSFORM

Name: Shape      Attributzahl: 2      Kinderzahl: 1      Vater: Transform
  Attribute: containerField      Wert: children
  Attribute: class      Wert: 
SHAPE

Name: IndexedFaceSet      Attributzahl: 9      Kinderzahl: 1      Vater: Shape
  Attribute: coordIndex      Wert: 0 1 2 -1, 1 3 2 -1, 2 3 0 -1, 3 1 0
  Attribute: ccw      Wert: true
  Attribute: colorPerVertex      Wert: true
  Attribute: convex      Wert: true
  Attribute: creaseAngle      Wert: 0
  Attribute: normalPerVertex      Wert: true
  Attribute: solid      Wert: true
  Attribute: containerField      Wert: geometry
  Attribute: class      Wert: 
INDEXEDFACESET

Name: Coordinate      Attributzahl: 3      Kinderzahl: 0      Vater: IndexedFaceSet
  Attribute: point      Wert: 0 0 0, 10 0 0, 5 0 8.3, 5 8.3 2.8
  Attribute: containerField      Wert: coordinate
  Attribute: class      Wert: 
COORDINATE


prev up next