Table of Contents Previous Chapter Details Viewpoint Slideshow Next Chapter Details X3D Resources

X3D Example Archives: Conformance Nist, Lights, Directional Light

X3D Scenes Descriptions
default complexdir Test browser to apply default values of a DirectionalLight node to complex geometry. The test should generate all three complex geometry with the default color. IndexedLineSet and PointSet are not lit geometry, therefore are not part of this test.
default primitivesdir Test browser to apply all the default values of a DirectionalLight node to simple geometry. A row containing all four simple geometry is drawn in the local coordinate system and a DirectionalLight node is defined at the beggining of the test. All figures should be illuminated with white light.
test - ambeffect - ambientcom This test addresses the effect of the DirectionalLight ambientIntensity on the ambient of a complex object (IndexedFaceSet). Two IndexedFaceSets are drawn in the local coordinate system and a DirectionaLight is defined to shine on them along the -Z axis. The IndexedFaceSet to the left contains an ambientIntensity 0.3 and the one to the right contains an initial ambientIntensity of 1. The ambientIntensity of the light is increased on both geometry as the animation progresses. Since both materials ambientIntensity are constants, at the end of the animation the one to the right will be brigther than the one to the left. This is because at the end of the animation the figure to the right will have maximum ambient (both material and light ambientIntensity will be 1)
test - ambeffect - ambientsim This test addresses the effect of the DirectionalLight ambientIntensity on the ambient of a simple object (Sphere). Two spheres are drawn in the local coordinate system and a DirectionaLight is defined to shine on them along the -Z axis. The sphere to the left contains an ambientIntensity 0.3 and the sphere to the right contains an initial ambientIntensity of 1 The ambientIntensity of the light is increased on both spheres as the animation progresses. Since both materials ambientIntensity are constants, at the end of the animation the one to the right will be brigther than the one to the left. This is because at the end of the animation the sphere to the right will have maximum ambient (both material and light ambientIntensity will be 1)
test - ambientcom Test browser to set the ambientIntensity field to a range of values on complex geometry (Extrusion, ElevationGrid and IndexedFaceSet). One row of the complex geometry is drawn in the local coordinate system. The ambientIntensity of the light should increase as the animation progresses. The animation is started by clicking on the text above the geometry. The ambientIntensity ranges from 0 to 1.
test - ambientsim Test browser to set the ambientIntensity field to a range of values on simple geometry (cone, sphere, cylinder and box). one row of the simple geometry is drawn in the local coordinate system. The ambientIntensity of the light should increase as the animation progresses. The animation is started by clicking on the text above the geometry. The ambientIntensity values range from 0 to 1.
test - attenuationcom Test browser to keep the brightness of the DirectionalLight constant regardless of how far an object is from the light source. The objects used are a set of complex geometry (Extrusion, ElevationGrid and IndexedFaceSet). one row of the complex geometry is drawn in the local coordinate system. The objects are moved further away from the light along the -Z axis as the animation progresses. The light should not attenuate at all. The animation is started by clicking on the text above the geometry.
test - attenuationsim Test browser to keep the brightness of the DirectionalLight constant regardless of how far an object is from the light source. The objects used are a set of simple geometry (cone, sphere, cylinder and box). one row of the simple geometry is drawn in the local coordinate system. The objects are moved further away from the light along the -Z axis as the animation progresses. The light should not attenuate at all. The animation is started by clicking on the text above the geometry.
test - colorcom Test browser to set the color field to a range of values on complex geometry (Extrusion, ElevationGrid and IndexedFaceSet). One row of the complex geometry is drawn in the local coordinate system. The amount of red, green and blue color in the light should increase as the animation progresses. The animation is started by clicking on the text above the geometry. The amount of color ranges from 0 0 0 to 1 1 1.
test - colorsim Test browser to set the color field to a range of values on simple geometry (cone, sphere, cylinder and box). one row of the simple geometry is drawn in the local coordinate system. The amount of red, green and blue color in the light should increase as the animation progresses. The animation is started by clicking on the text above the geometry. The amount of color ranges from 0 0 0 to 1 1 1.
test - directioncom Test browser to set the direction field to a range of values on a a complex geometry (Extrusion) The geometry is drawn in the local coordinate system and it should be a doughnut like "figure". The direction of the light is changed as the animation progresses. The animation is started by clicking on the text above the geometry. The direction values used are 0 0 1,1 0 0, 0 0 -1,-1 0 0.
test - directionsim Test browser to set the direction field to a range of values on a set of simple geometry (sphere) The geometry are drawn in the local coordinate system. The direction of the light is changed as the animation progresses. The animation is started by clicking on the text above the geometry. The direction values used are 0 0 1,1 0 0,0 0 -1,-1 0 0.
test - direffect - diffusecom This test addresses the effect of the light direction on the diffuse color of a complex geometry. One ElevationGrid is drawn in the local coordinate system and a DirectionalLight is also defined with intensity 1 and color white. The test starts by clicking on the text above the geometry. The direction of the light is increased as the test progresses and the diffuse color brightness of the object should also increase at those points where the light shines directly on them. The direction values used are: 1 0 0,0 0 -1,-1 0 0 0 0 1. The geometry is originally defined with a diffuseColor of 0 0 1.
test - direffect - diffusesim This test addresses the effect of the light direction on the diffuse color of a simple geometry. One simple geometry (sphere) is drawn in the local coordinate system and a DirectionalLight is also defined with intensity 1 and color 1 1 1. The test starts by clicking on the text above the geometry. The direction of the light is increased as the animation progresses and the diffuse color brightness of the object should also increase at those points where the light shines directly on the object. The direction values used are: 1 0 0,0 0 -1,1 0 0,0 0 1. The geometry are originally defined with a diffuseColor of 0 0 1.
test - direffect - specularcom This test addresses the effect of the light direction on the specular color of a complex geometry. One ElevationGrid is drawn in the local coordinate system and a DirectionalLight is also defined with intensity 1 and color white. The test starts by clicking on the text above the geometry. The direction of the light is increased as the test progresses and the specular color brightness of the object should also increase at those points where the light shines directly on them. The direction values used are: 1 0 0,0 0 -1,-1 0 0,0 0 1. The geometry is originally defined with a diffuseColor of 1 0 0 and a specularColor of 0 1 0.
test - direffect - specularsim This test addresses the effect of the light direction on the specular color of a simple geometry. One simple geometry (Sphere) is drawn in the local coordinate system and a DirectionalLight is also defined with intensity 1 and color white. The test starts by clicking on the text above the geometry. The direction of the light is changed as the test progresses and the specular color of the objects should be brighter at those areas where the light shines directly over the object. The geometry is originally defined with a diffuseColor of 1 0 0 and a specularColor of 0 1 0. The direction values used are 0 0 1,1 0 0, 0 0 -1,-1 0 0.
test - inteffect - diffusecom This test addresses the effect of the light intensity on the diffuse color of complex geometry. One row of complex geometry is drawn in the local coordinate system and a DirectionalLight is also defined with intensity 1 and color white. The test starts by clicking on the text above the geometry. The intensity of the light is increased as the test progresses and the diffuse color brightness of the objects should also increase. The geometry are originally defined with a diffuseColor of 0 0 1. Intensity values used range from 0 to 1.
test - inteffect - diffusesim This test addresses the effect of the light intensity on the diffuse color of simple geometry. One row of simple geometry is drawn in the local coordinate system and a DirectionalLight is also defined with intensity 0 and color 1 1 1. The test starts by clicking on the text above the geometry. The intensity of the light is increased as the animation progresses and the diffuse color brightness of the objects should also increase. Intensity values range from 0 to 1. The geometry are originally defined with a diffuseColor of 0 0 1.
test - inteffect - specularcom This test addresses the effect of the light intensity on the specular color of complex geometry. One row of complex geometry is drawn in the local coordinate system and a DirectionalLight is also defined with intensity 0 and color white. The test starts by clicking on the text above the geometry. The intensity of the light is increased as the test progresses and the specular color of the light should also increase (in a linear fashion). Intensity ranges from 0 to 1. The geometry are originally defined with a diffuseColor of 1 0 0 and a specularColor of 0 1 0.
test - inteffect - specularsim This test addresses the effect of the light intensity on the specular color of simple geometry. One row of simple geometry is drawn in the local coordinate system and a DirectionalLight is also defined with intensity 0 and color white. The test starts by clicking on the text above the geometry. The intensity of the light is increased as the test progresses and the specular color of the objects should also increase (in a linear fashion). Intensity values range from 0 to 1. The geometry are originally defined with a diffuseColor of 1 0 0 and a specularColor of 0 1 0.
test - intensitycom Test browser to set the intensity field to a range of values on complex geometry (Extrusion, ElevationGrid and IndexedFaceSet). One row of the complex geometry is drawn in the local coordinate system. The intensity of the light should increase as the animation progresses. The animation is started by clicking on the text above the geometry. The intensity ranges from 0 to 1.
test - intensitysim Test browser to set the intensity field to a range of values on simple geometry (cone, sphere, cylinder and box). one row of the simple geometry is drawn in the local coordinate system. The intensity of the light should increase as the animation progresses. The animation is started by clicking on the text above the geometry. The intensity ranges from 0 to 1.
test - on This test sets the on field to true/false for two DirectionalLight node defined using two different Transform node. The test should generate two default color/size spheres. The leftmost one sholud be illuminated while the rightmost one should be dark.
test - red - on - blue This test addresses the ability of a browser to apply a colored (red) light on an object of a different color (blue). Four simple geometries are defined in the local coordinate system and the emissive and diffuse color are both set to 0 0 1. A DirectionalLight is also defined and a red color is associated with it. This light illuminates the objects making them look black. The dot product of the light and object color produce a black appearing object.

Online at http://www.web3d.org/x3d/content/examples/ConformanceNist/Lights/DirectionalLight

Master source code archive is under subversion control at
http://sourceforge.net/p/x3d/code/HEAD/tree/www.web3d.org/x3d/content/examples/ConformanceNist/Lights/DirectionalLight

Table of Contents Previous Chapter Details Viewpoint Slideshow Next Chapter Details X3D Resources

Also available: current and archived nightly builds and distributions of these examples, all published under an Open-Source License.

The X3D Resources: Examples page and Savage Developers Guide provide more information about the production of this archive.