Matemática e Computação
 

Mensagens
Não te abandones em lugares onde a luz da tua harmonia não esteja presente.

 


Exemplo 117: Exemplos de Viewpoint

Viewpoint {
        position 0 0 35
        orientation 0 0 1 0
        fieldOfView 0.785398 # 90 graus em radianos
        description "Ver distante 35"
}
Viewpoint {
        position 0 0 25
        orientation 0 0 1 0
        fieldOfView 0.785398 # 90 graus em radianos
        description "Ver distante 25"
}
Viewpoint {
        position 0 0 15
        orientation 0 0 1 0
        fieldOfView 0.785398 # 90 graus em radianos
        description "Ver distante 15"
}
Viewpoint {
        position 0 0 5
        orientation 0 0 1 0
        fieldOfView 0.785398 # 90 graus em radianos
        description "Ver distante 5"
}
Shape {
        appearance Appearance { # define a aparência do Shape
                material Material {
                        diffuseColor 1.0 1.0 0.0 # r g b
                }
        }
        geometry Box { }
}

Exemplo 118: Exemplos de Viewpoint

Viewpoint {
======position 0 3 15
======orientation 0 0 1 0
======fieldOfView 0.785398 # 90 graus em radianos
======description "Ver de cima"
} # fim do Viewpoint
Viewpoint {
======position 0 -3 15
======orientation 0 0 1 0
======fieldOfView 0.785398 # 90 graus em radianos
======description "Ver de baixo"
} # fim do Viewpoint
Viewpoint {
======position 3 0 15
======orientation 0 0 1 0
======fieldOfView 0.785398 # 90 graus em radianos
======description "Ver de lado"
} # fim do Viewpoint
Viewpoint {
======position -3 0 15
======orientation 0 0 1 0
======fieldOfView 0.785398 # 90 graus em radianos
======description "Ver de lado"
} # fim do Viewpoint
Shape {
======appearance Appearance { # define a aparência do Shape
============material Material {
==================diffuseColor 1.0 1.0 0.0 # r g b
============}
======}
======geometry Box { }
} # fim do shape

Exemplo 119: Exemplos de Viewpoint

Background {
        skyColor 0 0.2 0
}
PointLight {
l        ocation 0 5 0
        color 1 0 0 # luz vermelha
        intensity 10
}
PointLight {
        location 0 -5 0
        color 1 0 1 # luz vermelha
        intensity 10
}
PointLight {
        location -5 0 0
        color 0 1 0 # luz verde
        intensity 10
}
PointLight {
        location 5 0 0
        color 0 0 1 # luz verde
        intensity 10
}
Viewpoint {
        position 0 4 15
        orientation 0 0 1 0
        fieldOfView 0.785398 # 90 graus em radianos
        description "Ver de cima"
}
Viewpoint {
        position 0 -4 15
        orientation 0 1 0 0
        fieldOfView 0.785398 # 90 graus em radianos
        description "Ver de baixo"
}
Viewpoint {
        position 5 0 15
        orientation 0 0 1 0
        fieldOfView 0.785398 # 90 graus em radianos
        description "Ver de lado"
}
Viewpoint {
        position -5 0 15
        orientation 0 0 1 0
        fieldOfView 0.785398 # 90 graus em radianos
        description "Ver de lado"
}
Shape {
        appearance Appearance { # define a aparência do Shape
                material Material {
                        diffuseColor 1.0 1.0 1.0 # r g b
                }
        }
        geometry Box { }
}

Exemplo 120: Exemplos de Viewpoint

DEF TR Transform {
        children [
                Viewpoint {
                        position 0 0 15
                        orientation 0 1 1 0.5
                        fieldOfView 0.685398 # 90 graus em radianos
                }
        ]
}
Shape {
        appearance Appearance { # define a aparência do Shape
                material Material {
                        diffuseColor 1.0 1.0 0.0 # r g b
                }
                texture ImageTexture {
                        url ["C:\VRML\Textura\fire.jpg"]
                }
        }
        geometry Box { }
}
DEF TT TouchSensor {
        enabled TRUE
}
DEF TS TimeSensor {
        cycleInterval 8
        loop FALSE
}
DEF OI OrientationInterpolator {
        key [0 0.20 0.40 0.60 0.80 1 ]
        keyValue [0 1 0 0, 0 1 0 3.14, 0 1 0 6.28, 1 0 0 0, 1 0 0 3.14, 1 0 0 6.28]
}
ROUTE TT.touchTime TO TS.startTime
ROUTE TS.fraction_changed TO OI.set_fraction
ROUTE OI.value_changed TO TR.rotation

Exemplo 121: Exemplos de Viewpoint

Viewpoint {
     position 0 10 0
     orientation 1 0 0 -1.57
     fieldOfView 0.785398 # 90 graus em radianos
     description "Ver de cima"
} # fim do Viewpoint
Viewpoint {
     position 0 -10 0
     orientation 1 0 0 1.5708
     fieldOfView 0.785398 # 90 graus em radianos
     description "Ver de baixo"
} # fim do Viewpoint
Viewpoint {
     position -10 0 0
     orientation 0 1 0 -1.5708
     fieldOfView 0.785398 # 90 graus em radianos
     description "Ver de lado esquerdo"
} # fim do Viewpoint
Viewpoint {
     position 10 0 0
     orientation 0 1 0 1.5708
     fieldOfView 0.785398 # 90 graus em radianos
     description "Ver de lado direito"
} # fim do Viewpoint
Shape {
     appearance Appearance { # define a aparência do Shape
          material Material {
               diffuseColor 1.0 1.0 0.0 # r g b
          }
          texture ImageTexture {
               url "dama.JPG"
          }
     }
     geometry Box {
          size 1 2 3
     }
} # fim do shape
Shape {
     appearance Appearance { # define a aparência do Shape
          material Material {
               diffuseColor 0.0 1.0 0.0 # r g b
          }
          texture ImageTexture {
               url "pordosol3.JPG"
          }
     }
     geometry Cone {
          bottomRadius 2
          height 3
     }
} # fim do shape

Exemplo 122: Exemplos de Background

Background {
        groundColor [
                0.10 0.10 0.0,      #A
                0.25 0.15 0.1,      #B
                0.60 0.60 0.20,    #C
        ]
        groundAngle [ 1.309, 1.571, 1.309]
        skyColor [
                0.0 0.2 0.5,       #D
                0.0 0.5 1.0,       #E
                1.0 1.0 1.0,       #F
        ]
        skyAngle [ 1.309, 1.571, 1.309]
}

Exemplo 123: Exemplos de Background

Background {
         skyAngle [ .05, .1, 2 ]
         skyColor [ 1 1 0, 1 1 0.5, 0 0 0.5, 0.2 1 1 ]
         groundAngle [ 1.57 ]
         groundColor [ 0.14 0.28 0, 0.09 0.11 0 ]
}

Shape {
         appearance Appearance {
                   material Material {
                             diffuseColor 0 0 1
                   }
         }
         geometry Box{}
}

Exemplo 124: Exemplos de Background

Background {
     groundColor [
          0.10 0.10 0.0, #A
          0.25 0.15 0.1, #B
          0.60 0.60 0.20, #C
          1.00 0.00 0.00, #C
          1.00 0.00 0.00 #C
     ]
     groundAngle [
          0.5,
          1.571,
          1.309,
          1.0,
          1.309
     ]
     skyColor [
          1 1 0,
          1 1 0.5,
          0.0 0.2 0.5, #D
          0.0 0.5 1.0, #E
          1.0 1.0 1.0, #F
     ]
     skyAngle [
          0.05,
          0.1,
          1.309,
          1.571,
          1.309
     ]
}

Exemplo 125: Exemplos de Background

Background {
                  frontUrl "Back01.jpg"
                  backUrl "Back02.jpg"
                  leftUrl "Back03.jpg"
                  rightUrl "Back04.jpg"
                  bottonUrl "Back05.jpg"
                  topUrl "Back06.jpg"
}

Exemplo 126: Exemplos de Background

Group {
        children [
                Background {
                        groundAngle [ 1.309, 1.571 ]
                        groundColor [ 0.1 0.1 0, 0.4 0.25 0.2, 0.6 0.6 0.6 ]
                        skyAngle [ 1.309, 1.571 ]
                        skyColor [ 0 0.2 0.7, 0 0.5 1, 1 1 1 ]
                }
                DEF AlternateBackground1 Background {
                        groundAngle [ 1.309, 1.571 ]
                        groundColor [ 0.1 0.1 0, 0.5 0.25 0.2, 0.6 0.6 0.2 ]
                        skyAngle [ 1.309, 1.571 ]
                        skyColor [ 1 0 0, 1 0.4 0, 1 1 0 ]
                }
                DEF AlternateBackground2 Background {
                        groundAngle [ 1.309, 1.571 ]
                        groundColor [ 0 0 0.1, 0 0.1 0.3, 0.3 0.3 0.6 ]
                        skyAngle [ 1.309, 1.571 ]
                        skyColor [ 1 0 0.8, 0.5 0 0.8, 0 0 0.8 ]
                }
                DEF AlternateBackground3 Background {
                        groundAngle [ 1.309, 1.571 ]
                        groundColor [ 0 0.7 0.1, 0 0.7 0.3, 0.3 0.8 0.6 ]
                        skyAngle [ 1.309, 1.571 ]
                        skyColor [ 1 0.7 0.8, 0.5 0.7 0.8, 0 0.9 0.8 ]
                }
        ]
}
Transform {
        translation 2 0 0
        children [
                Shape {
                        appearance Appearance {
                                material Material {
                                        diffuseColor 1 0 0
                                }
                        }
                        geometry Box {
                        }
                }
                DEF TouchBox TouchSensor {
                      # description "Alternate reddish-orange background"
                }
        ]
}
Transform {
        translation -2 0 0
        children [
                Shape {
                        appearance Appearance {
                                material Material {
                                        diffuseColor 0 0 0.8
                                }
                        }
                        geometry Sphere {
                        }
                }
                DEF TouchSphere TouchSensor {
                        # description "Alternate blueish-purple background"
                }
        ]
}
Transform {
        translation -2 0 0
        children [
                Shape {
                        appearance Appearance {
                                material Material {
                                        diffuseColor 0 1 0
                                }
                        }
                        geometry Cylinder { radius 0.7
                        }
                }
                DEF TouchCylinder TouchSensor {
                        # description "Alternate blueish-purple background"
                }
        ]
}
ROUTE TouchBox.isActive TO AlternateBackground1.set_bind
ROUTE TouchSphere.isActive TO AlternateBackground2.set_bind
ROUTE TouchCylinder.isActive TO AlternateBackground3.set_bind

Exemplo 127: Exemplos de Fog

Group {
      children [
            Fog {
                    color 1.0 1.0 0.0
                    fogType "LINEAR"
                    visibilityRange 100.0      # Teste com 40, 70 e 100
            },
            Background { skyColor 1.0 1.0 0.5 },
            Transform {
                    translation 5 0 0
                    children [
                            DEF Cilin Shape {
                                  appearance Appearance {
                                       material Material { diffuseColor 1 1 0 }
                                 }
                                 geometry Cylinder { radius 0.5 height 6 }
                          }
                  ]
          }
          Transform { translation -5 0 0 children USE Cilin }
          Transform { translation -5 0 -10 children USE Cilin }
          Transform { translation 5 0 -10 children USE Cilin }
          Transform { translation 5 0 -20 children USE Cilin }
          Transform { translation -5 0 -20 children USE Cilin }
          Transform { translation 5 0 -30 children USE Cilin }
          Transform { translation -5 0 -30 children USE Cilin }
          Transform { translation 5 0 -40 children USE Cilin }
          Transform { translation -5 0 -40 children USE Cilin }
          Transform { translation 5 0 -50 children USE Cilin }
          Transform { translation -5 0 -50 children USE Cilin }
          Transform { translation 5 0 -60 children USE Cilin }
          Transform { translation -5 0 -60 children USE Cilin }
      ]
}

Exemplo 128: Exemplos de Fog

Group {
        children [
                Fog {
                        color 1.0 1.0 0.0
                        fogType "EXPONENTIAL"
                        visibilityRange 100.0      # Teste com 40, 70 e 100
                },
                Background { skyColor 1.0 1.0 0.5 },
                Transform {
                        translation 5 0 0
                        children [
                                DEF Cilin Shape {
                                        appearance Appearance {
                                                 material Material {
                                                        diffuseColor .3 .09 .21
                                                        specularColor .67 .58 .83
                                                        ambientIntensity .0467
                                                        shininess .07
                                                 }
                                        }
                                        geometry Cylinder { radius 0.5 height 6 }
                                }
                        ]
                }
                Transform { translation -5 0 0 children USE Cilin }
                Transform { translation -5 0 -10 children USE Cilin }
                Transform { translation 5 0 -10 children USE Cilin }
                Transform { translation 5 0 -20 children USE Cilin }
                Transform { translation -5 0 -20 children USE Cilin }
                Transform { translation 5 0 -30 children USE Cilin }
                Transform { translation -5 0 -30 children USE Cilin }
                Transform { translation 5 0 -40 children USE Cilin }
                Transform { translation -5 0 -40 children USE Cilin }
                Transform { translation 5 0 -50 children USE Cilin }
                Transform { translation -5 0 -50 children USE Cilin }
                Transform { translation 5 0 -60 children USE Cilin }
                Transform { translation -5 0 -60 children USE Cilin }
        ]
}

Exemplo 129: Exemplos de Fog

Group {
        children [
                Fog {
                        color 1.0 0.0 1.0
                        fogType "LINEAR"        # Teste com EXPONENTIAL
                        visibilityRange 100.0     # Teste com 40, 70 e 100
                },
                Background { skyColor 0.6 0.3 0.0 },
                Transform {
                        translation 5 0 0
                        children [
                                DEF Cilin Shape {
                                        appearance Appearance {
                                                 material Material { diffuseColor 1 1 0 }
                                        }
                                        geometry Cylinder { radius 0.5 height 6 }
                                }
                        ]
                }
                Transform { translation -5 0 0 children USE Cilin }
                Transform { translation -5 0 -10 children USE Cilin }
                Transform { translation 5 0 -10 children USE Cilin }
                Transform { translation 5 0 -20 children USE Cilin }
                Transform { translation -5 0 -20 children USE Cilin }
                Transform { translation 5 0 -30 children USE Cilin }
                Transform { translation -5 0 -30 children USE Cilin }
                Transform { translation 5 0 -40 children USE Cilin }
                Transform { translation -5 0 -40 children USE Cilin }
                Transform { translation 5 0 -50 children USE Cilin }
                Transform { translation -5 0 -50 children USE Cilin }
                Transform { translation 5 0 -60 children USE Cilin }
                Transform { translation -5 0 -60 children USE Cilin }
                Transform { translation 5 0 -70 children USE Cilin }
                Transform { translation -5 0 -70 children USE Cilin }
                Transform { translation 5 0 -80 children USE Cilin }
                Transform { translation -5 0 -80 children USE Cilin }
        ]
}