Difference between revisions of "Canvas 3D - Light Tag"

From CDOT Wiki
Jump to: navigation, search
 
Line 5: Line 5:
 
== Introduction ==
 
== Introduction ==
  
The sounrce of light in a 3D world can be one of many types. These types are limited to Ambient (a light source from all directions) and Diffuse (Light cast from one point in a direction).  
+
The source of light in a 3D world can be one of many types. These types are limited to Ambient (a light source from all directions) and Diffuse (Light cast from one point in a direction).  
  
 
== Tag Attributes ==
 
== Tag Attributes ==
Line 19: Line 19:
 
* color
 
* color
 
** '''Usage:''' <light color="#FF00FF" />.
 
** '''Usage:''' <light color="#FF00FF" />.
** This determines the color of the light that is eing cast on the object. This values should be in Hex format.
+
** This determines the color of the light that is being cast on the object. This values should be in Hex format.
 
* position
 
* position
 
** '''Usage:''' <light position="0.3, 0.6, 2.1" />.
 
** '''Usage:''' <light position="0.3, 0.6, 2.1" />.
Line 28: Line 28:
 
** The ''orientation'' defines the direction the light source is pointing at.  
 
** The ''orientation'' defines the direction the light source is pointing at.  
 
** This attribute only applies to Diffuse Lighting and is ignored if used in another case.
 
** This attribute only applies to Diffuse Lighting and is ignored if used in another case.
** The default is {0.0, 0.0, 1.0} if ommited.
+
** The default is {0.0, 0.0, 1.0} if omited.
  
 
== Syntax ==
 
== Syntax ==

Latest revision as of 18:42, 20 October 2006

Light Tag Reference

Back To XML 3D Main Page

Introduction

The source of light in a 3D world can be one of many types. These types are limited to Ambient (a light source from all directions) and Diffuse (Light cast from one point in a direction).

Tag Attributes

  • number
    • Usage: <light number="3" />.
    • OpenGL handles many different lights at the same time and therefore requires an identifier to access them.
    • This number is restricted from 1 to 10.
  • type
    • Usage: <light type="diffuse" />.
    • This attributes specifies the type of light that will be created and the way it can be used.
    • The attribute only accepts the values of 'ambient' and 'diffuse'.
  • color
    • Usage: <light color="#FF00FF" />.
    • This determines the color of the light that is being cast on the object. This values should be in Hex format.
  • position
    • Usage: <light position="0.3, 0.6, 2.1" />.
    • The position attribute specifies the 3D location of the light source.
    • Three values must be specified as a 3D vector separated by commas.
  • orientation
    • Usage: <light orientation="4.1, 6.3, -2.8" />.
    • The orientation defines the direction the light source is pointing at.
    • This attribute only applies to Diffuse Lighting and is ignored if used in another case.
    • The default is {0.0, 0.0, 1.0} if omited.

Syntax

<canvas>
  <light number="1" position="0.0, 0.3, 0.5" orientation="0.2, 0.6, 1.3" color="#0000FF" type="diffuse" />
  <light number="2" position="5.0, 3.3, 0.1" color="#FF00FF" type="ambient" />
</canvas>

References