From 7b32ce330165e37f838f625960b779b2bb6e4c02 Mon Sep 17 00:00:00 2001
From: Anders Nilsson <anders.nilsson@cs.lth.se>
Date: Mon, 17 Sep 2007 15:51:54 +0200
Subject: [PATCH] Can now add a wire frame oriented bounding box to the x3d
 representation and then generate a new x3d file.

---
 examples/workpiece.x3d        | 26 +++++++------
 examples/x3d/BoundingBox.jrag | 71 ++++++++++++++++++++++++++++++-----
 examples/x3d/Demo.java        |  4 +-
 3 files changed, 78 insertions(+), 23 deletions(-)

diff --git a/examples/workpiece.x3d b/examples/workpiece.x3d
index 3ef55e6..97046c9 100644
--- a/examples/workpiece.x3d
+++ b/examples/workpiece.x3d
@@ -22,18 +22,20 @@
     <meta name="generator" content="Vrml97ToX3dNist, http://ovrt.nist.gov/v2_x3d.html"/>
   </head>
   <Scene>
-  <Transform >
-      <Shape >
-          <Appearance >
-              <Material  ambientIntensity="0.52" transparency="0.0" emissiveColor="0.0 0.0 0.0" shininess="0.4" diffuseColor="0.621176 0.621176 0.652549" specularColor="0.776471 0.776471 0.815686"/>
-          </Appearance>
-          <IndexedFaceSet  colorIndex=" 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0" coordIndex=" 58 38 42 -1 42 38 24 -1 42 24 26 -1 26 24 20 -1 26 20 22 -1 22 20 16 -1 22 16 18 -1 18 16 12 -1 18 12 14 -1 14 12 8 -1 14 8 10 -1 10 8 4 -1 10 4 6 -1 6 4 0 -1 6 0 2 -1 2 0 1 -1 2 1 3 -1 3 1 5 -1 3 5 7 -1 7 5 9 -1 7 9 11 -1 11 9 13 -1 11 13 15 -1 15 13 17 -1 15 17 19 -1 19 17 21 -1 19 21 23 -1 23 21 25 -1 23 25 27 -1 27 25 41 -1 27 41 45 -1 45 41 57 -1 45 57 59 -1 59 57 61 -1 59 61 63 -1 63 61 65 -1 63 65 67 -1 67 65 69 -1 67 69 71 -1 71 69 73 -1 71 73 75 -1 75 73 77 -1 75 77 79 -1 79 77 81 -1 79 81 83 -1 83 81 80 -1 83 80 82 -1 82 80 76 -1 82 76 78 -1 78 76 72 -1 78 72 74 -1 74 72 68 -1 74 68 70 -1 70 68 64 -1 70 64 66 -1 66 64 60 -1 66 60 62 -1 62 60 56 -1 62 56 58 -1 58 56 38 -1 23 27 37 -1 37 27 44 -1 10 32 14 -1 14 32 36 -1 14 36 18 -1 62 58 48 -1 48 58 43 -1 63 49 59 -1 59 49 44 -1 59 44 45 -1 45 44 27 -1 23 37 19 -1 19 37 33 -1 19 33 15 -1 58 42 43 -1 43 42 26 -1 43 26 36 -1 36 26 22 -1 36 22 18 -1 62 48 66 -1 66 48 52 -1 66 52 70 -1 29 7 33 -1 33 7 11 -1 33 11 15 -1 55 78 52 -1 52 78 74 -1 52 74 70 -1 75 53 71 -1 71 53 49 -1 71 49 67 -1 67 49 63 -1 10 6 32 -1 32 6 2 -1 32 2 29 -1 29 2 3 -1 29 3 7 -1 75 79 53 -1 53 79 83 -1 53 83 55 -1 55 83 82 -1 55 82 78 -1 20 24 34 -1 34 24 39 -1 61 57 47 -1 47 57 40 -1 61 47 65 -1 65 47 51 -1 65 51 69 -1 60 46 56 -1 56 46 39 -1 56 39 38 -1 38 39 24 -1 21 35 25 -1 25 35 40 -1 25 40 41 -1 41 40 57 -1 20 34 16 -1 16 34 30 -1 16 30 12 -1 54 77 51 -1 51 77 73 -1 51 73 69 -1 72 50 68 -1 68 50 46 -1 68 46 64 -1 64 46 60 -1 28 4 30 -1 30 4 8 -1 30 8 12 -1 9 31 13 -1 13 31 35 -1 13 35 17 -1 17 35 21 -1 72 76 50 -1 50 76 80 -1 50 80 54 -1 54 80 81 -1 54 81 77 -1 9 5 31 -1 31 5 1 -1 31 1 28 -1 28 1 0 -1 28 0 4 -1 35 44 40 -1 40 44 49 -1 40 49 47 -1 47 49 53 -1 47 53 51 -1 51 53 55 -1 51 55 54 -1 54 55 52 -1 54 52 50 -1 50 52 48 -1 50 48 46 -1 46 48 43 -1 46 43 39 -1 39 43 36 -1 39 36 34 -1 34 36 32 -1 34 32 30 -1 30 32 29 -1 30 29 28 -1 28 29 33 -1 28 33 31 -1 31 33 37 -1 31 37 35 -1 35 37 44 -1" colorPerVertex="false" normalPerVertex="true" normalIndex=" 21 18 18 -1 18 18 15 -1 18 15 15 -1 15 15 13 -1 15 13 13 -1 13 13 9 -1 13 9 9 -1 9 9 7 -1 9 7 7 -1 7 7 5 -1 7 5 5 -1 5 5 3 -1 5 3 3 -1 3 3 1 -1 3 1 1 -1 1 1 2 -1 1 2 2 -1 2 2 4 -1 2 4 4 -1 4 4 6 -1 4 6 6 -1 6 6 8 -1 6 8 8 -1 8 8 10 -1 8 10 10 -1 10 10 14 -1 10 14 14 -1 14 14 16 -1 14 16 16 -1 16 16 19 -1 16 19 19 -1 19 19 22 -1 19 22 22 -1 22 22 24 -1 22 24 24 -1 24 24 28 -1 24 28 28 -1 28 28 30 -1 28 30 30 -1 30 30 32 -1 30 32 32 -1 32 32 34 -1 32 34 34 -1 34 34 36 -1 34 36 36 -1 36 36 35 -1 36 35 35 -1 35 35 33 -1 35 33 33 -1 33 33 31 -1 33 31 31 -1 31 31 29 -1 31 29 29 -1 29 29 27 -1 29 27 27 -1 27 27 23 -1 27 23 23 -1 23 23 21 -1 23 21 21 -1 21 21 18 -1 20 20 20 -1 20 20 20 -1 20 20 20 -1 20 20 20 -1 20 20 20 -1 20 20 20 -1 20 20 20 -1 20 20 20 -1 20 20 20 -1 20 20 20 -1 20 20 20 -1 20 20 20 -1 20 20 20 -1 20 20 20 -1 20 20 20 -1 20 20 20 -1 20 20 20 -1 20 20 20 -1 20 20 20 -1 20 20 20 -1 20 20 20 -1 20 20 20 -1 20 20 20 -1 20 20 20 -1 20 20 20 -1 20 20 20 -1 20 20 20 -1 20 20 20 -1 20 20 20 -1 20 20 20 -1 20 20 20 -1 20 20 20 -1 20 20 20 -1 20 20 20 -1 20 20 20 -1 20 20 20 -1 20 20 20 -1 20 20 20 -1 20 20 20 -1 20 20 20 -1 20 20 20 -1 20 20 20 -1 17 17 17 -1 17 17 17 -1 17 17 17 -1 17 17 17 -1 17 17 17 -1 17 17 17 -1 17 17 17 -1 17 17 17 -1 17 17 17 -1 17 17 17 -1 17 17 17 -1 17 17 17 -1 17 17 17 -1 17 17 17 -1 17 17 17 -1 17 17 17 -1 17 17 17 -1 17 17 17 -1 17 17 17 -1 17 17 17 -1 17 17 17 -1 17 17 17 -1 17 17 17 -1 17 17 17 -1 17 17 17 -1 17 17 17 -1 17 17 17 -1 17 17 17 -1 17 17 17 -1 17 17 17 -1 17 17 17 -1 17 17 17 -1 17 17 17 -1 17 17 17 -1 17 17 17 -1 17 17 17 -1 17 17 17 -1 17 17 17 -1 17 17 17 -1 17 17 17 -1 17 17 17 -1 17 17 17 -1 25 18 18 -1 18 18 11 -1 18 11 11 -1 11 11 5 -1 11 5 5 -1 5 5 0 -1 5 0 0 -1 0 0 6 -1 0 6 6 -1 6 6 12 -1 6 12 12 -1 12 12 19 -1 12 19 19 -1 19 19 26 -1 19 26 26 -1 26 26 32 -1 26 32 32 -1 32 32 37 -1 32 37 37 -1 37 37 31 -1 37 31 31 -1 31 31 25 -1 31 25 25 -1 25 25 18 -1">
-              <Coordinate  point="-0.041913 -0.095791 0.072034, -0.041913 -0.095791 0.074647, -0.041913 -0.090791 0.072034, -0.041913 -0.090791 0.074647, -0.04137 -0.095791 0.069478, -0.04137 -0.095791 0.077203, -0.04137 -0.090791 0.069478, -0.04137 -0.090791 0.077203, -0.040307 -0.095791 0.067091, -0.040307 -0.095791 0.079591, -0.040307 -0.090791 0.067091, -0.040307 -0.090791 0.079591, -0.038771 -0.095791 0.064976, -0.038771 -0.095791 0.081705, -0.038771 -0.090791 0.064976, -0.038771 -0.090791 0.081705, -0.036829 -0.095791 0.063228, -0.036829 -0.095791 0.083453, -0.036829 -0.090791 0.063228, -0.036829 -0.090791 0.083453, -0.034566 -0.095791 0.061921, -0.034566 -0.095791 0.08476, -0.034566 -0.090791 0.061921, -0.034566 -0.090791 0.08476, -0.03208 -0.095791 0.061114, -0.03208 -0.095791 0.085567, -0.03208 -0.090791 0.061114, -0.03208 -0.090791 0.085567, -0.031131 -0.095791 0.073341, -0.031131 -0.090791 0.073341, -0.03091 -0.095791 0.072516, -0.03091 -0.095791 0.074166, -0.03091 -0.090791 0.072516, -0.03091 -0.090791 0.074166, -0.030306 -0.095791 0.071912, -0.030306 -0.095791 0.074769, -0.030306 -0.090791 0.071912, -0.030306 -0.090791 0.074769, -0.029481 -0.095791 0.060841, -0.029481 -0.095791 0.071691, -0.029481 -0.095791 0.074991, -0.029481 -0.095791 0.085841, -0.029481 -0.090791 0.060841, -0.029481 -0.090791 0.071691, -0.029481 -0.090791 0.074991, -0.029481 -0.090791 0.085841, -0.028656 -0.095791 0.071912, -0.028656 -0.095791 0.074769, -0.028656 -0.090791 0.071912, -0.028656 -0.090791 0.074769, -0.028052 -0.095791 0.072516, -0.028052 -0.095791 0.074166, -0.028052 -0.090791 0.072516, -0.028052 -0.090791 0.074166, -0.027831 -0.095791 0.073341, -0.027831 -0.090791 0.073341, -0.026882 -0.095791 0.061114, -0.026882 -0.095791 0.085567, -0.026882 -0.090791 0.061114, -0.026882 -0.090791 0.085567, -0.024397 -0.095791 0.061921, -0.024397 -0.095791 0.08476, -0.024397 -0.090791 0.061921, -0.024397 -0.090791 0.08476, -0.022134 -0.095791 0.063228, -0.022134 -0.095791 0.083453, -0.022134 -0.090791 0.063228, -0.022134 -0.090791 0.083453, -0.020192 -0.095791 0.064976, -0.020192 -0.095791 0.081705, -0.020192 -0.090791 0.064976, -0.020192 -0.090791 0.081705, -0.018656 -0.095791 0.067091, -0.018656 -0.095791 0.079591, -0.018656 -0.090791 0.067091, -0.018656 -0.090791 0.079591, -0.017593 -0.095791 0.069478, -0.017593 -0.095791 0.077203, -0.017593 -0.090791 0.069478, -0.017593 -0.090791 0.077203, -0.01705 -0.095791 0.072034, -0.01705 -0.095791 0.074647, -0.01705 -0.090791 0.072034, -0.01705 -0.090791 0.074647, "/>
-              <Color  color="0.776471 0.776471 0.815686 "/>
-              <Normal  vector="-1.0 0.0 -0.0, -0.994522 0.0 -0.104528, -0.994522 0.0 0.104528, -0.951057 0.0 -0.309017, -0.951057 0.0 0.309017, -0.866025 0.0 -0.5, -0.866025 0.0 0.5, -0.743145 0.0 -0.669131, -0.743145 0.0 0.669131, -0.587785 0.0 -0.809017, -0.587785 0.0 0.809017, -0.5 0.0 -0.866025, -0.5 0.0 0.866025, -0.406737 0.0 -0.913545, -0.406737 0.0 0.913545, -0.207912 0.0 -0.978148, -0.207912 0.0 0.978148, 0.0 -1.0 0.0, 0.0 0.0 -1.0, 0.0 0.0 1.0, 0.0 1.0 0.0, 0.207912 0.0 -0.978148, 0.207912 0.0 0.978148, 0.406737 0.0 -0.913545, 0.406737 0.0 0.913545, 0.5 0.0 -0.866025, 0.5 0.0 0.866025, 0.587785 0.0 -0.809017, 0.587785 0.0 0.809017, 0.743145 0.0 -0.669131, 0.743145 0.0 0.669131, 0.866025 0.0 -0.5, 0.866025 0.0 0.5, 0.951057 0.0 -0.309017, 0.951057 0.0 0.309017, 0.994522 0.0 -0.104528, 0.994522 0.0 0.104528, 1.0 0.0 0.0, "/>
-          </IndexedFaceSet>
-      </Shape>
-  </Transform>
+
+<!--   <Transform > -->
+<!--       <Shape > -->
+<!--           <Appearance > -->
+<!--               <Material  ambientIntensity="0.52" transparency="0.0" emissiveColor="0.0 0.0 0.0" shininess="0.4" diffuseColor="0.621176 0.621176 0.652549" specularColor="0.776471 0.776471 0.815686"/> -->
+<!--           </Appearance> -->
+<!--           <IndexedFaceSet  colorIndex=" 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0" coordIndex=" 58 38 42 -1 42 38 24 -1 42 24 26 -1 26 24 20 -1 26 20 22 -1 22 20 16 -1 22 16 18 -1 18 16 12 -1 18 12 14 -1 14 12 8 -1 14 8 10 -1 10 8 4 -1 10 4 6 -1 6 4 0 -1 6 0 2 -1 2 0 1 -1 2 1 3 -1 3 1 5 -1 3 5 7 -1 7 5 9 -1 7 9 11 -1 11 9 13 -1 11 13 15 -1 15 13 17 -1 15 17 19 -1 19 17 21 -1 19 21 23 -1 23 21 25 -1 23 25 27 -1 27 25 41 -1 27 41 45 -1 45 41 57 -1 45 57 59 -1 59 57 61 -1 59 61 63 -1 63 61 65 -1 63 65 67 -1 67 65 69 -1 67 69 71 -1 71 69 73 -1 71 73 75 -1 75 73 77 -1 75 77 79 -1 79 77 81 -1 79 81 83 -1 83 81 80 -1 83 80 82 -1 82 80 76 -1 82 76 78 -1 78 76 72 -1 78 72 74 -1 74 72 68 -1 74 68 70 -1 70 68 64 -1 70 64 66 -1 66 64 60 -1 66 60 62 -1 62 60 56 -1 62 56 58 -1 58 56 38 -1 23 27 37 -1 37 27 44 -1 10 32 14 -1 14 32 36 -1 14 36 18 -1 62 58 48 -1 48 58 43 -1 63 49 59 -1 59 49 44 -1 59 44 45 -1 45 44 27 -1 23 37 19 -1 19 37 33 -1 19 33 15 -1 58 42 43 -1 43 42 26 -1 43 26 36 -1 36 26 22 -1 36 22 18 -1 62 48 66 -1 66 48 52 -1 66 52 70 -1 29 7 33 -1 33 7 11 -1 33 11 15 -1 55 78 52 -1 52 78 74 -1 52 74 70 -1 75 53 71 -1 71 53 49 -1 71 49 67 -1 67 49 63 -1 10 6 32 -1 32 6 2 -1 32 2 29 -1 29 2 3 -1 29 3 7 -1 75 79 53 -1 53 79 83 -1 53 83 55 -1 55 83 82 -1 55 82 78 -1 20 24 34 -1 34 24 39 -1 61 57 47 -1 47 57 40 -1 61 47 65 -1 65 47 51 -1 65 51 69 -1 60 46 56 -1 56 46 39 -1 56 39 38 -1 38 39 24 -1 21 35 25 -1 25 35 40 -1 25 40 41 -1 41 40 57 -1 20 34 16 -1 16 34 30 -1 16 30 12 -1 54 77 51 -1 51 77 73 -1 51 73 69 -1 72 50 68 -1 68 50 46 -1 68 46 64 -1 64 46 60 -1 28 4 30 -1 30 4 8 -1 30 8 12 -1 9 31 13 -1 13 31 35 -1 13 35 17 -1 17 35 21 -1 72 76 50 -1 50 76 80 -1 50 80 54 -1 54 80 81 -1 54 81 77 -1 9 5 31 -1 31 5 1 -1 31 1 28 -1 28 1 0 -1 28 0 4 -1 35 44 40 -1 40 44 49 -1 40 49 47 -1 47 49 53 -1 47 53 51 -1 51 53 55 -1 51 55 54 -1 54 55 52 -1 54 52 50 -1 50 52 48 -1 50 48 46 -1 46 48 43 -1 46 43 39 -1 39 43 36 -1 39 36 34 -1 34 36 32 -1 34 32 30 -1 30 32 29 -1 30 29 28 -1 28 29 33 -1 28 33 31 -1 31 33 37 -1 31 37 35 -1 35 37 44 -1" colorPerVertex="false" normalPerVertex="true" normalIndex=" 21 18 18 -1 18 18 15 -1 18 15 15 -1 15 15 13 -1 15 13 13 -1 13 13 9 -1 13 9 9 -1 9 9 7 -1 9 7 7 -1 7 7 5 -1 7 5 5 -1 5 5 3 -1 5 3 3 -1 3 3 1 -1 3 1 1 -1 1 1 2 -1 1 2 2 -1 2 2 4 -1 2 4 4 -1 4 4 6 -1 4 6 6 -1 6 6 8 -1 6 8 8 -1 8 8 10 -1 8 10 10 -1 10 10 14 -1 10 14 14 -1 14 14 16 -1 14 16 16 -1 16 16 19 -1 16 19 19 -1 19 19 22 -1 19 22 22 -1 22 22 24 -1 22 24 24 -1 24 24 28 -1 24 28 28 -1 28 28 30 -1 28 30 30 -1 30 30 32 -1 30 32 32 -1 32 32 34 -1 32 34 34 -1 34 34 36 -1 34 36 36 -1 36 36 35 -1 36 35 35 -1 35 35 33 -1 35 33 33 -1 33 33 31 -1 33 31 31 -1 31 31 29 -1 31 29 29 -1 29 29 27 -1 29 27 27 -1 27 27 23 -1 27 23 23 -1 23 23 21 -1 23 21 21 -1 21 21 18 -1 20 20 20 -1 20 20 20 -1 20 20 20 -1 20 20 20 -1 20 20 20 -1 20 20 20 -1 20 20 20 -1 20 20 20 -1 20 20 20 -1 20 20 20 -1 20 20 20 -1 20 20 20 -1 20 20 20 -1 20 20 20 -1 20 20 20 -1 20 20 20 -1 20 20 20 -1 20 20 20 -1 20 20 20 -1 20 20 20 -1 20 20 20 -1 20 20 20 -1 20 20 20 -1 20 20 20 -1 20 20 20 -1 20 20 20 -1 20 20 20 -1 20 20 20 -1 20 20 20 -1 20 20 20 -1 20 20 20 -1 20 20 20 -1 20 20 20 -1 20 20 20 -1 20 20 20 -1 20 20 20 -1 20 20 20 -1 20 20 20 -1 20 20 20 -1 20 20 20 -1 20 20 20 -1 20 20 20 -1 17 17 17 -1 17 17 17 -1 17 17 17 -1 17 17 17 -1 17 17 17 -1 17 17 17 -1 17 17 17 -1 17 17 17 -1 17 17 17 -1 17 17 17 -1 17 17 17 -1 17 17 17 -1 17 17 17 -1 17 17 17 -1 17 17 17 -1 17 17 17 -1 17 17 17 -1 17 17 17 -1 17 17 17 -1 17 17 17 -1 17 17 17 -1 17 17 17 -1 17 17 17 -1 17 17 17 -1 17 17 17 -1 17 17 17 -1 17 17 17 -1 17 17 17 -1 17 17 17 -1 17 17 17 -1 17 17 17 -1 17 17 17 -1 17 17 17 -1 17 17 17 -1 17 17 17 -1 17 17 17 -1 17 17 17 -1 17 17 17 -1 17 17 17 -1 17 17 17 -1 17 17 17 -1 17 17 17 -1 25 18 18 -1 18 18 11 -1 18 11 11 -1 11 11 5 -1 11 5 5 -1 5 5 0 -1 5 0 0 -1 0 0 6 -1 0 6 6 -1 6 6 12 -1 6 12 12 -1 12 12 19 -1 12 19 19 -1 19 19 26 -1 19 26 26 -1 26 26 32 -1 26 32 32 -1 32 32 37 -1 32 37 37 -1 37 37 31 -1 37 31 31 -1 31 31 25 -1 31 25 25 -1 25 25 18 -1"> -->
+<!--               <Coordinate  point="-0.041913 -0.095791 0.072034, -0.041913 -0.095791 0.074647, -0.041913 -0.090791 0.072034, -0.041913 -0.090791 0.074647, -0.04137 -0.095791 0.069478, -0.04137 -0.095791 0.077203, -0.04137 -0.090791 0.069478, -0.04137 -0.090791 0.077203, -0.040307 -0.095791 0.067091, -0.040307 -0.095791 0.079591, -0.040307 -0.090791 0.067091, -0.040307 -0.090791 0.079591, -0.038771 -0.095791 0.064976, -0.038771 -0.095791 0.081705, -0.038771 -0.090791 0.064976, -0.038771 -0.090791 0.081705, -0.036829 -0.095791 0.063228, -0.036829 -0.095791 0.083453, -0.036829 -0.090791 0.063228, -0.036829 -0.090791 0.083453, -0.034566 -0.095791 0.061921, -0.034566 -0.095791 0.08476, -0.034566 -0.090791 0.061921, -0.034566 -0.090791 0.08476, -0.03208 -0.095791 0.061114, -0.03208 -0.095791 0.085567, -0.03208 -0.090791 0.061114, -0.03208 -0.090791 0.085567, -0.031131 -0.095791 0.073341, -0.031131 -0.090791 0.073341, -0.03091 -0.095791 0.072516, -0.03091 -0.095791 0.074166, -0.03091 -0.090791 0.072516, -0.03091 -0.090791 0.074166, -0.030306 -0.095791 0.071912, -0.030306 -0.095791 0.074769, -0.030306 -0.090791 0.071912, -0.030306 -0.090791 0.074769, -0.029481 -0.095791 0.060841, -0.029481 -0.095791 0.071691, -0.029481 -0.095791 0.074991, -0.029481 -0.095791 0.085841, -0.029481 -0.090791 0.060841, -0.029481 -0.090791 0.071691, -0.029481 -0.090791 0.074991, -0.029481 -0.090791 0.085841, -0.028656 -0.095791 0.071912, -0.028656 -0.095791 0.074769, -0.028656 -0.090791 0.071912, -0.028656 -0.090791 0.074769, -0.028052 -0.095791 0.072516, -0.028052 -0.095791 0.074166, -0.028052 -0.090791 0.072516, -0.028052 -0.090791 0.074166, -0.027831 -0.095791 0.073341, -0.027831 -0.090791 0.073341, -0.026882 -0.095791 0.061114, -0.026882 -0.095791 0.085567, -0.026882 -0.090791 0.061114, -0.026882 -0.090791 0.085567, -0.024397 -0.095791 0.061921, -0.024397 -0.095791 0.08476, -0.024397 -0.090791 0.061921, -0.024397 -0.090791 0.08476, -0.022134 -0.095791 0.063228, -0.022134 -0.095791 0.083453, -0.022134 -0.090791 0.063228, -0.022134 -0.090791 0.083453, -0.020192 -0.095791 0.064976, -0.020192 -0.095791 0.081705, -0.020192 -0.090791 0.064976, -0.020192 -0.090791 0.081705, -0.018656 -0.095791 0.067091, -0.018656 -0.095791 0.079591, -0.018656 -0.090791 0.067091, -0.018656 -0.090791 0.079591, -0.017593 -0.095791 0.069478, -0.017593 -0.095791 0.077203, -0.017593 -0.090791 0.069478, -0.017593 -0.090791 0.077203, -0.01705 -0.095791 0.072034, -0.01705 -0.095791 0.074647, -0.01705 -0.090791 0.072034, -0.01705 -0.090791 0.074647, "/> -->
+<!--               <Color  color="0.776471 0.776471 0.815686 "/> -->
+<!--               <Normal  vector="-1.0 0.0 -0.0, -0.994522 0.0 -0.104528, -0.994522 0.0 0.104528, -0.951057 0.0 -0.309017, -0.951057 0.0 0.309017, -0.866025 0.0 -0.5, -0.866025 0.0 0.5, -0.743145 0.0 -0.669131, -0.743145 0.0 0.669131, -0.587785 0.0 -0.809017, -0.587785 0.0 0.809017, -0.5 0.0 -0.866025, -0.5 0.0 0.866025, -0.406737 0.0 -0.913545, -0.406737 0.0 0.913545, -0.207912 0.0 -0.978148, -0.207912 0.0 0.978148, 0.0 -1.0 0.0, 0.0 0.0 -1.0, 0.0 0.0 1.0, 0.0 1.0 0.0, 0.207912 0.0 -0.978148, 0.207912 0.0 0.978148, 0.406737 0.0 -0.913545, 0.406737 0.0 0.913545, 0.5 0.0 -0.866025, 0.5 0.0 0.866025, 0.587785 0.0 -0.809017, 0.587785 0.0 0.809017, 0.743145 0.0 -0.669131, 0.743145 0.0 0.669131, 0.866025 0.0 -0.5, 0.866025 0.0 0.5, 0.951057 0.0 -0.309017, 0.951057 0.0 0.309017, 0.994522 0.0 -0.104528, 0.994522 0.0 0.104528, 1.0 0.0 0.0, "/> -->
+<!--           </IndexedFaceSet> -->
+<!--       </Shape> -->
+<!--   </Transform> -->
+
   <Transform >
       <Shape >
           <Appearance >
diff --git a/examples/x3d/BoundingBox.jrag b/examples/x3d/BoundingBox.jrag
index cd608f7..ae713a0 100644
--- a/examples/x3d/BoundingBox.jrag
+++ b/examples/x3d/BoundingBox.jrag
@@ -82,21 +82,74 @@ aspect WireFrame {
 
     public void Scene.addWireFrameBB(BoundingVolume bb) {
         StringBuffer sb = new StringBuffer().append("\"");
-        if (bb instanceof OrientedBoundingBox) {
-            Vector3f[] corners = ((OrientedBoundingBox) bb).vectorStore;
-            for (int i=0; i<corners.length; i++) {
-                Vector3f p = corners[i];
-                sb.append(String.valueOf((int) p.getX())).append(" ");
-                sb.append(String.valueOf((int) p.getY())).append(" ");
-                sb.append(String.valueOf((int) p.getZ())).append("   ");
+//         if (bb instanceof OrientedBoundingBox) {
+//             ((OrientedBoundingBox) bb).computeCorners();
+//             Vector3f[] corners = ((OrientedBoundingBox) bb).vectorStore;
+            Vector3f c = bb.getCenter();
+            Vector3f e = new Vector3f();
+            if (bb instanceof BoundingBox) {
+                e = ((BoundingBox) bb).getExtent(null);                
+            } else {
+                e = ((OrientedBoundingBox) bb).getExtent();                
             }
-        }
+        System.out.println("Center: X="+c.getX()+" Y="+c.getY()+
+                           " Z="+c.getZ());
+        System.out.println("Extent: X="+e.getX()+" Y="+e.getY()+
+                           " Z="+e.getZ());
+        System.out.println("Volume: "+bb.getVolume());
+//             for (int i=0; i<8; i++) {
+//                 Vector3f p = corners[i];
+        sb.append(String.valueOf(c.x - e.x)).append(" ");
+        sb.append(String.valueOf(c.y - e.y)).append(" ");
+        sb.append(String.valueOf(c.z - e.z)).append("   ");
+
+        sb.append(String.valueOf(c.x + e.x)).append(" ");
+        sb.append(String.valueOf(c.y - e.y)).append(" ");
+        sb.append(String.valueOf(c.z - e.z)).append("   ");
+
+        sb.append(String.valueOf(c.x + e.x)).append(" ");
+        sb.append(String.valueOf(c.y + e.y)).append(" ");
+        sb.append(String.valueOf(c.z - e.z)).append("   ");
+
+        sb.append(String.valueOf(c.x - e.x)).append(" ");
+        sb.append(String.valueOf(c.y + e.y)).append(" ");
+        sb.append(String.valueOf(c.z - e.z)).append("   ");
+
+        sb.append(String.valueOf(c.x - e.x)).append(" ");
+        sb.append(String.valueOf(c.y - e.y)).append(" ");
+        sb.append(String.valueOf(c.z + e.z)).append("   ");
+
+        sb.append(String.valueOf(c.x + e.x)).append(" ");
+        sb.append(String.valueOf(c.y - e.y)).append(" ");
+        sb.append(String.valueOf(c.z + e.z)).append("   ");
+
+        sb.append(String.valueOf(c.x + e.x)).append(" ");
+        sb.append(String.valueOf(c.y + e.y)).append(" ");
+        sb.append(String.valueOf(c.z + e.z)).append("   ");
+
+        sb.append(String.valueOf(c.x - e.x)).append(" ");
+        sb.append(String.valueOf(c.y + e.y)).append(" ");
+        sb.append(String.valueOf(c.z + e.z)).append("   ");
+
+//             }
+//         }
+//         if (bb instanceof OrientedBoundingBox) {
+//             ((OrientedBoundingBox) bb).computeCorners();
+//             Vector3f[] corners = ((OrientedBoundingBox) bb).vectorStore;
+//             for (int i=0; i<corners.length; i++) {
+//                 Vector3f p = corners[i];
+//                 sb.append(String.valueOf( p.getX())).append(" ");
+//                 sb.append(String.valueOf( p.getY())).append(" ");
+//                 sb.append(String.valueOf( p.getZ())).append("   ");
+//             }
+//         }
         sb.append("\"");
         Coordinate coord = new Coordinate(new List().
                                           add(new point(new AttrValue(sb.toString()))),
                                           new List());
         colorPerVertex cpv = new colorPerVertex(new AttrValue("\"false\""));
-        String cis = "\"0 1 1 3 3 2 2 0 0 4 4 5 5 1 1 5 5 7 7 3 3 7 7 6 6 2 2 6 6 4\"";
+//         String cis = "\"0 1 1 3 3 2 2 0 0 4 4 5 5 1 1 5 5 7 7 3 3 7 7 6 6 2 2 6 6 4\"";
+        String cis = "\"0 1 2 3 0 4 5 1 5 6 2 6 7 3 7 4\"";
         coordIndex ci = new coordIndex(new AttrValue(cis));
         IndexedLineSet ils = new IndexedLineSet(new List().add(cpv).add(ci),
                                                 new List().add(coord));
diff --git a/examples/x3d/Demo.java b/examples/x3d/Demo.java
index 53f07c2..46d3268 100644
--- a/examples/x3d/Demo.java
+++ b/examples/x3d/Demo.java
@@ -32,14 +32,14 @@ public class Demo extends Parser {
 
         String s = new String();
         try {
-            s = con.readLine("%s","$");
+            s = con.readLine("%s","1$");
             ast.prettyPrint("  ",new PrintStream("x3d_demo.x3d"));
+            s = con.readLine("%s","2$");
             ast.addWireFrameBB(obb);
             ast.prettyPrint("  ",new PrintStream("x3d_demo.x3d"));
         } catch (FileNotFoundException e) {
             e.printStackTrace();
         }
-        System.out.println("****** "+s);
 
     }
 }
-- 
GitLab