|
|
VRML Script Tutorial
Full list
VRML Interactive Tutorial
Introduction
VRML File Structure
Drawing: Shape node
Geometry Nodes:
Appearance
Let there be Light
Materials with Colored Lights
Hierarchical Node Structures
Inlining Files
Defining and Instancing Nodes
Defining Levels of Detail
Events in VRML
Interpolators
Let the Music Play
Bindable Nodes
Adding Realism to the world
Information about your world
Definition for Auxiliary Nodes
|
|
|
|
PointLight Node
If you're new to lighting in VRML, there is a Lighting
section in this tutorial which discusses general features of lighting in
VRML. In here only the aspects which are particular to Point Lights are
discussed.
Point Lights define a light source in a specified location. The
light rays from this type of lights go in all directions. This implies
that, as opposed to Directional Lights,
Point Lights have a location but not a direction field. The
following figure attempts to define a Point Light graphically (the point
where the light rays start is the light location.
This light lits all nodes regardless of their position in the file, i.e.
this light is not scoped. There is however a way of limiting the volume
which is lit by this light, one can specify a radius which defines
the maximum distance that the light rays can travel. Objects which are
further away from the light source than the radius are not lit by
the light source.
There is still another way to control the attenuation within the
sphere defined by the radius. Using the attenuation field one can
specify how the light grows dimmer with distance, within the sphere defined
by the radius.
The following fields are present in this node:
on specifies if the light is active. This is a boolean field.
intensity has values between 0.0 and 1.0. Higher values specify
stronger lights.
ambientIntensity specifies how much this light contributes to
the overall lighting .Values must be between 0.0 and 1.0
color is a RGB field to specify the color of the light..
location which specifies a vector in 3D defining the coordinates
of the light in your world.
attenuation is a 3D vector that specifies how the light looses
its intensity as distance from the light source increases. All vector values
must be greater than or equal to zero
radius specifies the maximum distance for the light rays to
travel. Must be greater than or equal to zero.
Syntax:
|
PointLight { |
on TRUE
intensity 1
ambientIntensity 0
color 1 1 1
location 0 0 0
attenuation 1 0 0
radius 100
|
} |
|
Note: On the VRML world presented as example the sphere
is placed at -2.5 0 0, the cone
is placed at the origin, and the cylinder
is placed at 2.5 0 0. If you're not familiar with placing shapes other
than at the origin see the Transform
node.
|