Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
X
XMLSchemaCompiler
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Anders Nilsson
XMLSchemaCompiler
Commits
58f52600
Commit
58f52600
authored
17 years ago
by
Anders Nilsson
Browse files
Options
Downloads
Patches
Plain Diff
Fixed bounding box wire-frame also for AABB.
parent
978c39a8
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
examples/x3d/Demo.java
+6
-2
6 additions, 2 deletions
examples/x3d/Demo.java
with
6 additions
and
2 deletions
examples/x3d/Demo.java
+
6
−
2
View file @
58f52600
...
@@ -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 X
3D
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
)
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment