Matemática e Computação
 

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

 


SpotLight - Os focos de luz que brilham numa direção definida a partir de um ponto, irradiando sob a forma de um cone de abertura parametrizável.

Todos os tipos de luz tem os seguintes campos:

on (TRUE / FALSE): liga e desliga a luz;
intensity: o brilho da luz;
ambientIntensity: a contribuição para a luz ambiente geral da cena;
color: a cor da luz emitida.

As luzes pontuais e os focos de luz ainda partilham os seguintes campos:

     location: localização da luz no mundo;

     radius: distância máxima afetada pela luz;

     attenuation: atenuação da luz com a distância.

Por fim, as luzes direcionadas e os focos de luz partilham o campo diretion, que especifica a direção de propagação da luz.

Sintaxe do nó SpotLight:

SpotLight { 
        on TRUE 
        intensity 1 
        ambientIntensity 0 
        color 1 1 1 
        location 0 0 0 
        direction 0 0 0 
        attenuation 1 0 0 
        radius 100 
        cutOffAngle 0.78 
        beamWidth 1.57 

Exemplo 90: Veja a seguir exemplos do SpotLight

SpotLight {
        color 1 0 0
        location -5 0 2
        direction 1 0 0
        cutOffAngle 0.785398
        beamWidth 0.470796
        intensity 10
        radius 15
}
DEF Esfera Shape {
        appearance Appearance {
                material Material {
                        diffuseColor 1.0 1.0 1.0
                }
        }
        geometry Sphere { radius 1.5
        }
}

Exemplo 91: Veja a seguir exemplos do SpotLight

NavigationInfo {
        headlight TRUE
        type "EXAMINE"
}

SpotLight {
        color 1 0 0
        location -5 5 5
        direction 1 -1 -1
        cutOffAngle 0.785398
        beamWidth 0.470796
        intensity 10
        radius 15
}

DEF Esfera Shape {
        appearance Appearance {
                material Material {
                        diffuseColor 1.0 1.0 1.0 # r g b
                }
        }
        geometry Sphere { radius 1.5
        }
}

Exemplo 92: Veja a seguir exemplos do SpotLight

NavigationInfo {
        headlight FALSE
        type "EXAMINE"
}

Exemplo 93: Veja a seguir exemplos do SpotLight

Background {
        skyColor 0 0.2 0
}
NavigationInfo {
        headlight TRUE
        type "EXAMINE"
}
SpotLight {
        color 1 0 0
        location -5 0 0
        direction 1 0 0
        cutOffAngle 0.785398
        beamWidth 0.470796
        intensity 10
        radius 15
}

Transform {
        translation 0 -1.5 0
        children [
                DEF Esfera Shape {
                        appearance Appearance {
                                material Material {
                                        diffuseColor 1.0 1.0 1.0 # r g b
                                }
                        }
                        geometry Sphere { radius 1.5 }
                }
        ]
}
Transform {
        translation 0 1.5 0
        children USE Esfera
}

Exemplo 94: Veja a seguir exemplos do SpotLight

NavigationInfo {
        headlight FALSE
        type "EXAMINE"
}

Exemplo 95: Veja a seguir exemplos do SpotLight

Background {
        skyColor 0 0.2 0
}
NavigationInfo {
        headlight TRUE
        type "EXAMINE"
}

SpotLight {
        color 1 0 0
        location -5 0 5
        direction 1 0 -1
        cutOffAngle 0.785398
        beamWidth 0.470796
        intensity 10
        radius 15
}
SpotLight {
        color 0 0 1
        location 5 0 5
        direction -1 0 -1
        cutOffAngle 0.785398
        beamWidth 0.470796
        intensity 10
        radius 15
}
DEF Esfera Shape {
        appearance Appearance {
                material Material {
                        diffuseColor 1.0 1.0 1.0 # r g b
                }
        }
        geometry Sphere { radius 1.5 }
}
Transform {
        translation 0 3 0
        children USE Esfera
}
Transform {
        translation 0 -3 0
        children USE Esfera
}

Exemplo 96: Veja a seguir exemplos do SpotLight

NavigationInfo {
        headlight FALSE
        type "EXAMINE"
}

Exemplo 97: Veja a seguir exemplos do SpotLight

Background {
        skyColor 0 0.2 0
}
NavigationInfo {
        headlight TRUE
        type "EXAMINE"
}
SpotLight {
        color 1 0 0
        location -5 5 5
        direction 1 -1 -1
        cutOffAngle 0.13
        beamWidth 0.1
        intensity 10
        radius 15
}
SpotLight {
        color 0 0 1
        location 5 -5 5
        direction -1 1 -1
        cutOffAngle 0.13
        beamWidth 0.1
        intensity 10
        radius 15
}
DEF Esfera Shape {
        appearance Appearance {
                material Material {
                        diffuseColor 1.0 1.0 1.0 # r g b
                }
        }
        geometry Sphere { radius 1.5 }
}

Exemplo 98: Veja a seguir exemplos do SpotLight

NavigationInfo {
        headlight FALSE
        type "EXAMINE"
}

Exemplo 99: Veja a seguir exemplos do SpotLight

# Background { skyColor 1 1 1 }
Viewpoint {
        position 0 0 20
}
Group {
        children [
                Transform {
                        children Shape {
                                appearance DEF A1 Appearance {
                                        material Material {
                                                ambientIntensity .117
                                                diffuseColor 1 1 1
                                                specularColor .92 .73 .51
                                                shininess .9
                                        }
                                }
                                geometry Box { size 5 5 5 }
                        }
                }
                DEF L1 SpotLight {
                        location 7.0 7.0 7.0
                        direction -1 -1 -1
                        beamWidth 0.0017
                        cutOffAngle 0.005708
                        color 0 0 1
                        intensity 1
                }
                DEF L2 SpotLight {
                        location -7 7 -7
                        direction 1 -1 1
                        beamWidth 0.017
                        cutOffAngle 0.05708
                        color 0 1 0
                }
                DEF L3 SpotLight {
                        location -7 7 7
                        direction 1 -1 -1
                        beamWidth 0.0017
                        cutOffAngle 0.005708
                        color 1 0 0
                }
                NavigationInfo {
                        headlight TRUE
                        type "EXAMINE"
                }
        ]
}

Exemplo 100: Veja a seguir exemplos do SpotLight

                NavigationInfo {
                        headlight FALSE
                        type "EXAMINE"
                }