El nodo Group permite unir un conjunto de nodos de
forma que actúen como una entidad única, pero sin efectuar ninguna
transformación en ellos.
La principal característica de este tipo de grupo
es que los objetos son creados todos en el mismo punto (en el centro del
escenario de realidad virtual 0 0 0).
Sintaxis:
Group {
children [ ... ]
}
children [ ... ]
}
El campo
children contiene la lista de
los objetos que se quieren agrupar, representados por sus nodos Shape
respectivos:
Ejemplo
GENERAL:
Group {
children [
Shape { ... },
Shape { ... },
...
]
}
children [
Shape { ... },
Shape { ... },
...
]
}
Ejemplo:
#VRML
V2.0 utf8
#Le
agregaré un transform a group
Transform {
translation
0 0 -100
rotation
0 0 0 0
scale .5
.5 .5
children
[
#Aquí
empieza el nodo Group
Group{
children[
#Marco
de enfrente de la casa
#Palo horizontal arriba
Transform {
translation 24 2 0
children[
Shape {
appearance Appearance{
texture
ImageTexture { url "maderaoscura.jpg" }
}
geometry Box { size 80 4 4 }
}
]
}
#Palo
vertical izquierdo
Transform {
translation
-16 -8.5 0
rotation
0 0 0 0
children
[
Shape {
appearance
Appearance{
texture
ImageTexture { url "maderaoscura.jpg" }
}
geometry
Box { size 2 25 4 }
}
]
}
#Palo horizontal abajo
Transform {
translation 24.5 -21 0
children[
Shape {
appearance Appearance{
texture
ImageTexture { url "maderaoscura.jpg" }
}
geometry Box { size 83 2 4 }
}
]
}
#Palo
vertical puerta
Transform {
translation
40 -8.5 0
rotation
0 0 0 0
children
[
Shape {
appearance Appearance{
texture
ImageTexture { url "maderaoscura.jpg" }
}
geometry Box { size 2 25 4 }
}
]
}
#Palo
vertical orilla derecha
Transform {
translation
65 -8.5 0
rotation
0 0 0 0
children
[
Shape {
appearance Appearance{
texture
ImageTexture { url "maderaoscura.jpg" }
}
geometry Box { size 2 25 4 }
}
]
}
#Concreto
blanco arriba techo
Transform {
translation 44.5 8 -49.5
children[
Shape {
appearance Appearance{
texture
ImageTexture { url "tirol.png" }
}
geometry Box { size 160 8 115 }
}
]
}
#Concreto
blanco vertical enmedio
Transform {
translation
70 -9 2
rotation
0 0 0 0
children
[
Shape {
appearance Appearance{
texture
ImageTexture { url "tirol.png" }
}
geometry Box { size 8 26 8 }
}
]
}
#Concreto
blanco vertical orilla derecha
Transform {
translation
109.75 -9 2
rotation
0 0 0 0
children
[
Shape {
appearance Appearance{
texture
ImageTexture { url "tirol.png" }
}
geometry Box { size 22 26 8 }
}
]
}
#Palo
horizontal abajo puerta
Transform {
translation 86.25 -21 0
children[
Shape {
appearance Appearance{
texture
ImageTexture { url "maderaoscura.jpg" }
}
geometry Box { size 24.5 2 4 }
}
]
}
#Palo
horizontal arriba puerta
Transform {
translation 86.25 2 0
children[
Shape {
appearance
Appearance{
texture
ImageTexture { url "maderaoscura.jpg" }
}
geometry Box { size 24.5 4 4 }
}
]
}
#Palo
vertical puerta de la orilla izquierdo
Transform {
translation
75 -10 0
rotation
0 0 0 0
children
[
Shape {
appearance Appearance{
texture
ImageTexture { url "maderaoscura.jpg" }
}
geometry Box { size 2 20 4 }
}
]
}
#Palo
vertical puerta de la orilla derecha
Transform
{
translation 97.5 -10 0
rotation 0 0 0 0
children [
Shape {
appearance Appearance{
texture
ImageTexture { url "maderaoscura.jpg" }
}
geometry Box { size 2 20 4 }
}
]
}
#Concreto
pared derecha
Transform {
translation 122.75 -9 -43
children[
Shape {
appearance Appearance{
texture
ImageTexture { url "tirol.png" }
}
geometry Box { size 4 26 97.75 }
}
]
}
#Palo
horizontal arriba cara izquierda
Transform
{
translation -16 2 -46.75
children[
Shape {
appearance Appearance{
texture
ImageTexture { url "maderaoscura.jpg" }
}
geometry Box { size 2 4 90 }
}
]
}
#Palo
horizontal abajo cara izquierda
Transform
{
translation
-16 -20 -46.85
children[
Shape {
appearance Appearance{
texture
ImageTexture { url "maderaoscura.jpg" }
}
geometry Box { size 2 4 90 }
}
]
}
#Palo
vertical izquierdo cara izquierda
Transform
{
translation -16 -9 -93.75
rotation 0 0 0 0
children [
Shape {
appearance Appearance{
texture
ImageTexture { url "maderaoscura.jpg" }
}
geometry Box { size 2 26 4 }
}
]
}
#Pared
del fondo
Transform
{
translation 55 -9 -93.75
rotation
0 0 0 0
children
[
Shape {
appearance Appearance{
texture
ImageTexture { url "tirol.png" }
}
geometry Box { size 140 26 5 }
}
]
}
]
}
]
}

No hay comentarios:
Publicar un comentario