Skip to content
Snippets Groups Projects
Commit 58f52600 authored by Anders Nilsson's avatar Anders Nilsson
Browse files

Fixed bounding box wire-frame also for AABB.

parent 978c39a8
No related branches found
No related tags found
No related merge requests found
...@@ -11,11 +11,12 @@ public class Demo extends Parser { ...@@ -11,11 +11,12 @@ public class Demo extends Parser {
Vector3f vec; Vector3f vec;
BoundingBox aabb = ast.aabb(); BoundingBox aabb = ast.aabb();
System.out.println();
System.out.println("AxisAligned BoundingBox"); System.out.println("AxisAligned BoundingBox");
vec = aabb.getCenter(); vec = aabb.getCenter();
System.out.println("Center: X="+vec.getX()+" Y="+vec.getY()+ System.out.println("Center: X="+vec.getX()+" Y="+vec.getY()+
" Z="+vec.getZ()); " Z="+vec.getZ());
vec = aabb.getExtent(vec); vec = aabb.getExtent(null);
System.out.println("Extent: X="+vec.getX()+" Y="+vec.getY()+ System.out.println("Extent: X="+vec.getX()+" Y="+vec.getY()+
" Z="+vec.getZ()); " Z="+vec.getZ());
System.out.println("Volume: "+aabb.getVolume()); System.out.println("Volume: "+aabb.getVolume());
...@@ -30,14 +31,17 @@ public class Demo extends Parser { ...@@ -30,14 +31,17 @@ public class Demo extends Parser {
" Z="+vec.getZ()); " Z="+vec.getZ());
System.out.println("Volume: "+obb.getVolume()); System.out.println("Volume: "+obb.getVolume());
System.out.println();
String s = new String(); String s = new String();
try { try {
ast.prettyPrint(" ",new PrintStream("x3d_demo.x3d")); ast.prettyPrint(" ",new PrintStream("x3d_demo.x3d"));
System.out.println("Generated X#D with original model"); System.out.println("Generated X3D original model");
s = con.readLine("%s","Press enter to include OBB wire-frame"); s = con.readLine("%s","Press enter to include OBB wire-frame");
System.out.println();
ast.addWireFrameBB(obb); ast.addWireFrameBB(obb);
ast.prettyPrint(" ",new PrintStream("x3d_demo.x3d")); ast.prettyPrint(" ",new PrintStream("x3d_demo.x3d"));
s = con.readLine("%s","Press enter to include AABB wire-frame"); s = con.readLine("%s","Press enter to include AABB wire-frame");
System.out.println();
ast.addWireFrameBB(aabb); ast.addWireFrameBB(aabb);
ast.prettyPrint(" ",new PrintStream("x3d_demo.x3d")); ast.prettyPrint(" ",new PrintStream("x3d_demo.x3d"));
} catch (FileNotFoundException e) { } catch (FileNotFoundException e) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment