#VRML V2.0 utf8
# X3D-to-VRML-97 XSL translation autogenerated by X3dToVrml97.xslt
# https://www.web3d.org/x3d/content/X3dToVrml97.xslt
# Generated using XSLT processor: Saxonica
# [X3D] VRML V3.0 utf8
# PROFILE Immersive
# [X3D] version=3.0
# [X3D] noNamespaceSchemaLocation=https://www.web3d.org/specifications/x3d-3.0.xsd
# [head]
# META "title" "QuadTreeExamples.x3d"
# META "creator" "Don Brutzman"
# META "created" "26 June 2000"
# META "modified" "20 January 2020"
# META "description" "Show four ways of solving the QuadTree problem using native XML tags, PROTOs, IDREF/USE and MFNode children compatibly - view XML source to see DTD internal-subset declarations."
# META "error" "Test to demonstrate DOCTYPE extensibility, this X3D scene not valid and does not render."
### Error:
# META "warning" "You must view full source of the DTD declarations (QuadTreeExamples.x3d.txt) to fully understand validation techniques in this file."
# META "reference" "QuadTreeExamplesExplanation.html"
# META "reference" "QuadTreeExamples.x3d.txt"
# META "reference" "QuadTreeExamples.png"
# META "identifier" "https://www.web3d.org/x3d/content/examples/development/QuadTreeExamples.x3d"
# META "generator" "X3D-Edit 3.1, https://www.web3d.org/x3d/content/README.X3D-Edit.html"
# META "license" "../license.html"
# [Scene] ========== ========== ==========
NavigationInfo { type [ "EXAMINE" "ANY" ] } ### Default X3D NavigationInfo
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Example solution approach #1
# Note that PROTO declarations are also provided for compatible backwards translation to VRML 97 encoding. They are not necessary for independent X3D use of the QuadTree examples.
PROTO QuadTree-USEchildren [
### Info: MFNode not provided for field 'upperLeftDEFName' with @accessType='inputOutput'. (Authors can silence this warning by inserting a comment.)
exposedField MFNode upperLeftDEFName [ ]
### Info: MFNode not provided for field 'upperRightDEFName' with @accessType='inputOutput'. (Authors can silence this warning by inserting a comment.)
exposedField MFNode upperRightDEFName [ ]
### Info: MFNode not provided for field 'lowerLeftDEFName' with @accessType='inputOutput'. (Authors can silence this warning by inserting a comment.)
exposedField MFNode lowerLeftDEFName [ ]
### Info: MFNode not provided for field 'lowerRightDEFName' with @accessType='inputOutput'. (Authors can silence this warning by inserting a comment.)
exposedField MFNode lowerRightDEFName [ ]
### Warning: ProtoInterface is unreferenced in ProtoBody with no corresponding IS/connect/@protoField
### Info: MFNode not provided for field 'children' with @accessType='inputOutput'. (Authors can silence this warning by inserting a comment.)
exposedField MFNode children [ ]
# children field must be declared for any PROTOs or native-tag nodes with children
] {
Group {
children [
DEF GroupA Group {
children IS upperLeftDEFName
}
DEF GroupB Group {
children IS upperRightDEFName
}
DEF GroupC Group {
children IS lowerLeftDEFName
}
DEF GroupD Group {
children IS lowerRightDEFName
}
]
}
}
# Example solution approach #3
PROTO QuadTree-TagChildren [
exposedField MFNode upperLeftNode [ ]
# no initialization node
exposedField MFNode upperRightNode [ ]
# no initialization node
exposedField MFNode lowerLeftNode [ ]
# no initialization node
exposedField MFNode lowerRightNode [ ]
# no initialization node
### Warning: ProtoInterface is unreferenced in ProtoBody with no corresponding IS/connect/@protoField
### Info: MFNode not provided for field 'children' with @accessType='inputOutput'. (Authors can silence this warning by inserting a comment.)
exposedField MFNode children [ ]
] {
Group {
children [
DEF GroupE Group {
children IS upperLeftNode
}
DEF GroupF Group {
children IS upperRightNode
}
DEF GroupG Group {
children IS lowerLeftNode
}
DEF GroupH Group {
children IS lowerRightNode
}
]
}
}
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Group {
children [
Viewpoint {
description "View QuadTree examples"
position 0 0 30
}
DEF Example_1 Transform {
translation 0 6 0
children [
QuadTree-USEchildren {
children [
Group {
children [
DEF UPPER_LEFT Transform {
translation 4 0 4
children [
Shape {
appearance DEF RED Appearance {
material Material {
diffuseColor 1 0 0
}
}
geometry Box {
}
}
]
}
DEF UPPER_RIGHT Transform {
translation 3 0 -3
children [
Shape {
appearance DEF GREEN Appearance {
material Material {
diffuseColor 0 1 0
}
}
geometry Sphere {
}
}
]
}
DEF LOWER_LEFT Transform {
translation -3 0 -3
children [
Shape {
appearance DEF BLUE Appearance {
material Material {
diffuseColor .2 .2 1
}
}
geometry Cylinder {
}
}
]
}
DEF LOWER_RIGHT Transform {
translation -6 0 4
children [
Shape {
appearance DEF WHITE Appearance {
material Material {
diffuseColor 1 1 1
}
}
geometry Text {
string [ "QuadTree-USEchildren" "ProtoInstance" ]
}
}
]
}
]
}
]
upperLeftDEFName [
USE UPPER_LEFT
]
upperRightDEFName [
USE UPPER_RIGHT
]
lowerLeftDEFName [
USE LOWER_LEFT
]
lowerRightDEFName [
USE LOWER_RIGHT
]
}
]
}
DEF Example_2 Transform {
translation 0 2 0
children [
QuadTree-USEchildren {
children [
# children which follow are locally convenient and referenced via IDREF/USE
DEF LOWER_RIGHT_EXAMPLE_2 Transform {
translation -6 0 4
children [
Shape {
geometry Text {
string [ "QuadTree-USEchildren" "Native tags" ]
}
appearance USE WHITE
}
]
}
]
upperLeftDEFName [
USE UPPER_LEFT
]
upperRightDEFName [
USE UPPER_RIGHT
]
lowerLeftDEFName [
USE LOWER_LEFT
]
lowerRightDEFName [
USE LOWER_RIGHT_EXAMPLE_2
]
}
]
}
DEF Example_3 Transform {
translation 0 -2 0
children [
QuadTree-TagChildren {
upperLeftNode [
USE UPPER_LEFT
]
upperRightNode [
USE UPPER_RIGHT
]
lowerLeftNode [
USE LOWER_LEFT
]
lowerRightNode [
Transform {
translation -6 0 4
children [
Shape {
geometry Text {
string [ "QuadTree-TagChildren" "ProtoInstance" ]
}
appearance USE WHITE
}
]
}
]
}
]
}
DEF Example_4 Transform {
translation 0 -6 0
children [
QuadTree-TagChildren {
upperLeftNode [
USE UPPER_LEFT
]
upperRightNode [
USE UPPER_RIGHT
]
lowerLeftNode [
USE LOWER_LEFT
]
lowerRightNode [
Transform {
translation -6 0 4
children [
Shape {
geometry Text {
string [ "QuadTree-TagChildren" "Native tags" ]
}
appearance USE WHITE
}
]
}
WorldInfo {
info [ "this WorldInfo is here to demonstrate that the example is type MFNode" ]
}
]
}
]
}
]
}
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -