Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VRMLLoader: New implementation #16726

Merged
merged 2 commits into from Jun 8, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions examples/js/libs/chevrotain.min.js

Large diffs are not rendered by default.

2,758 changes: 1,996 additions & 762 deletions examples/js/loaders/VRMLLoader.js

Large diffs are not rendered by default.

2,771 changes: 2,006 additions & 765 deletions examples/jsm/loaders/VRMLLoader.js

Large diffs are not rendered by default.

86 changes: 86 additions & 0 deletions examples/models/vrml/test/creaseAngle.wrl
@@ -0,0 +1,86 @@
#VRML V2.0 utf8

#Created by Cinema 4D

DEF Plane Transform {
children [
Shape {
appearance DEF MAT_Mat Appearance {
material Material {
ambientIntensity 0.2
diffuseColor 0.33 0.33 0.33
specularColor 0.025 0.025 0.025
emissiveColor 0 0 0
shininess 0.025
transparency 0
}
}
geometry DEF FACESET_Plane IndexedFaceSet {
ccw FALSE
creaseAngle 0.698132
coord Coordinate {
point [ -200 0 -200,-200 0 0,-200 0 200,0 0 -200,0 0 0,
0 0 200,200 0 -200,200 0 0,200 0 200
]
}
texCoord TextureCoordinate {
point [ 0 0,
0.5 0,1 0,0 0.5,0.5 0.5,1 0.5,
0 1,0.5 1,1 1
]
}
coordIndex [ 0,3,4,1,-1,1,4,5,2,-1,3,6,7,4,-1,
4,7,8,5,-1
]
texCoordIndex [ 0,3,4,1,-1,1,4,5,2,-1,3,6,7,4,-1,
4,7,8,5,-1
]
}
}
]
}
DEF Null Transform {
translation 0 -200 0
children [
DEF Platonic Transform {
translation 0 400 0
children [
Shape {
appearance USE MAT_Mat
geometry DEF FACESET_Platonic IndexedFaceSet {
ccw FALSE
creaseAngle 3.141593
coord Coordinate {
point [ -85.065216 52.573195 0,-85.065216 -52.573195 0,-52.573195 0 85.065216,52.573195 0 85.065216,85.065216 52.573195 0,
85.065216 -52.573195 0,52.573195 0 -85.065216,-52.573195 0 -85.065216,0 85.065216 52.573195,0 85.065216 -52.573195,
0 -85.065216 -52.573195,0 -85.065216 52.573195
]
}
texCoord TextureCoordinate {
point [ 0.5 0,1 1,1 1,
0 1,0.5 0,0 1,0.5 0,1 1,
0.5 0,0 1,1 1,0 1,0.5 0,
1 1,0.5 0,1 1,0 1,1 1,
0 1,0.5 0,1 1,0 1,0.5 0,
0 1,1 1,0 1,1 1,0.5 0,
1 1,0.5 0,1 1,0 1
]
}
coordIndex [ 9,8,0,-1,8,2,0,-1,8,3,2,-1,8,4,3,-1,
8,9,4,-1,4,9,6,-1,6,9,7,-1,9,0,7,-1,
11,10,1,-1,2,11,1,-1,2,3,11,-1,3,5,11,-1,
5,10,11,-1,5,6,10,-1,6,7,10,-1,7,1,10,-1,
1,7,0,-1,2,1,0,-1,4,5,3,-1,4,6,5,-1
]
texCoordIndex [ 25,24,0,-1,23,7,0,-1,23,10,6,-1,23,13,8,-1,
23,26,12,-1,11,26,19,-1,18,26,22,-1,25,1,22,-1,
31,28,4,-1,5,30,4,-1,5,10,29,-1,9,15,29,-1,
16,28,29,-1,16,17,27,-1,18,20,27,-1,21,2,27,-1,
3,20,0,-1,5,2,0,-1,11,15,8,-1,11,17,14,-1
]
}
}
]
}
]
}
120 changes: 120 additions & 0 deletions examples/models/vrml/test/crystal.wrl
@@ -0,0 +1,120 @@
#VRML V2.0 utf8
WorldInfo { title "created By KrystalShaper"}
NavigationInfo { type "EXAMINE"}
DEF BKG Background { skyColor [ 1.0 1.0 1.0 ] }

Transform { children [ Shape{
appearance Appearance{material Material{diffuseColor 0.0 1.0 1.0 }}
geometry IndexedFaceSet{ coord Coordinate{ point[
-0.6423 1.0 0.3744 ,
0.5456 1.0 0.1594 ,
0.5864 1.0 0.0723 ,
0.6423 1.0 -0.3744 ,
-0.5456 1.0 -0.1594 ,
-0.5864 1.0 -0.0723 ,
]} coordIndex[ 0,1,2,3,4,5, -1] }}]}

Transform { children [ Shape{
appearance Appearance{material Material{diffuseColor 0.0 1.0 1.0 }}
geometry IndexedFaceSet{ coord Coordinate{ point[
-0.5864 -1.0 -0.0723 ,
-0.5456 -1.0 -0.1594 ,
0.6423 -1.0 -0.3744 ,
0.5864 -1.0 0.0723 ,
0.5456 -1.0 0.1594 ,
-0.6423 -1.0 0.3744 ,
]} coordIndex[ 0,1,2,3,4,5, -1] }}]}

Transform { children [ Shape{
appearance Appearance{material Material{diffuseColor 0.0 0.0 1.0 }}
geometry IndexedFaceSet{ coord Coordinate{ point[
-1.2103 0.0 0.4772 ,
-0.6423 -1.0 0.3744 ,
0.5456 -1.0 0.1594 ,
1.1135 0.0 0.0566 ,
0.5456 1.0 0.1594 ,
-0.6423 1.0 0.3744 ,
]} coordIndex[ 0,1,2,3,4,5, -1] }}]}

Transform { children [ Shape{
appearance Appearance{material Material{diffuseColor 0.0 0.0 1.0 }}
geometry IndexedFaceSet{ coord Coordinate{ point[
1.2103 0.0 -0.4772 ,
0.6423 -1.0 -0.3744 ,
-0.5456 -1.0 -0.1594 ,
-1.1135 0.0 -0.0566 ,
-0.5456 1.0 -0.1594 ,
0.6423 1.0 -0.3744 ,
]} coordIndex[ 0,1,2,3,4,5, -1] }}]}

Transform { children [ Shape{
appearance Appearance{material Material{diffuseColor 0.275 1.0 0.333 }}
geometry IndexedFaceSet{ coord Coordinate{ point[
0.6423 1.0 -0.3744 ,
0.5864 1.0 0.0723 ,
1.1544 0.0 -0.0305 ,
1.2103 0.0 -0.4772 ,
]} coordIndex[ 0,1,2,3, -1] }}]}

Transform { children [ Shape{
appearance Appearance{material Material{diffuseColor 0.275 1.0 0.333 }}
geometry IndexedFaceSet{ coord Coordinate{ point[
-0.6423 1.0 0.3744 ,
-0.5864 1.0 -0.0723 ,
-1.1544 0.0 0.0305 ,
-1.2103 0.0 0.4772 ,
]} coordIndex[ 0,1,2,3, -1] }}]}

Transform { children [ Shape{
appearance Appearance{material Material{diffuseColor 0.275 1.0 0.333 }}
geometry IndexedFaceSet{ coord Coordinate{ point[
-1.2103 0.0 0.4772 ,
-1.1544 0.0 0.0305 ,
-0.5864 -1.0 -0.0723 ,
-0.6423 -1.0 0.3744 ,
]} coordIndex[ 0,1,2,3, -1] }}]}

Transform { children [ Shape{
appearance Appearance{material Material{diffuseColor 0.275 1.0 0.333 }}
geometry IndexedFaceSet{ coord Coordinate{ point[
1.2103 0.0 -0.4772 ,
1.1544 0.0 -0.0305 ,
0.5864 -1.0 0.0723 ,
0.6423 -1.0 -0.3744 ,
]} coordIndex[ 0,1,2,3, -1] }}]}

Transform { children [ Shape{
appearance Appearance{material Material{diffuseColor 1.0 0.275 0.373 }}
geometry IndexedFaceSet{ coord Coordinate{ point[
1.1135 0.0 0.0566 ,
1.1544 0.0 -0.0305 ,
0.5864 1.0 0.0723 ,
0.5456 1.0 0.1594 ,
]} coordIndex[ 0,1,2,3, -1] }}]}

Transform { children [ Shape{
appearance Appearance{material Material{diffuseColor 1.0 0.275 0.373 }}
geometry IndexedFaceSet{ coord Coordinate{ point[
-1.1135 0.0 -0.0566 ,
-1.1544 0.0 0.0305 ,
-0.5864 1.0 -0.0723 ,
-0.5456 1.0 -0.1594 ,
]} coordIndex[ 0,1,2,3, -1] }}]}

Transform { children [ Shape{
appearance Appearance{material Material{diffuseColor 1.0 0.275 0.373 }}
geometry IndexedFaceSet{ coord Coordinate{ point[
-0.5456 -1.0 -0.1594 ,
-0.5864 -1.0 -0.0723 ,
-1.1544 0.0 0.0305 ,
-1.1135 0.0 -0.0566 ,
]} coordIndex[ 0,1,2,3, -1] }}]}

Transform { children [ Shape{
appearance Appearance{material Material{diffuseColor 1.0 0.275 0.373 }}
geometry IndexedFaceSet{ coord Coordinate{ point[
0.5456 -1.0 0.1594 ,
0.5864 -1.0 0.0723 ,
1.1544 0.0 -0.0305 ,
1.1135 0.0 0.0566 ,
]} coordIndex[ 0,1,2,3, -1] }}]}
33 changes: 33 additions & 0 deletions examples/models/vrml/test/lines.wrl
@@ -0,0 +1,33 @@
#VRML V2.0 utf8
#IndexedLineSet example
Shape {
geometry IndexedLineSet {
coord Coordinate {
point [
-1.0 -1.0 0.0, #vertex 0
1.0 1.0 0.0, #vertex 1
1.0 -1.0 0.0, #vertex 2
]
}
colorPerVertex FALSE
color Color {
color [
1.0 0.0 0.0, #red
0.0 1.0 0.0, #green
0.0 0.0 1.0, #blue
]
}
coordIndex [
#red line
0, 1, -1,
#green line
1, 2, -1,
#blue line
2, 0, -1
]
colorIndex [
2, 1, 0
]
}
}

Binary file added examples/models/vrml/test/map.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.