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

From CDOT Wiki
Jump to: navigation, search
Line 1: Line 1:
= Cube Tag Reference =
+
= Light Tag Reference =
  
 
[[XML_3D_-_BTS530/630 Project|Back To XML 3D Main Page]]
 
[[XML_3D_-_BTS530/630 Project|Back To XML 3D Main Page]]
Line 5: Line 5:
 
== Introduction ==
 
== Introduction ==
  
Intro.
+
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).  
  
 
== Tag Attributes ==
 
== Tag Attributes ==
  
 
* number
 
* 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
 
* 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
 
* color
 +
** '''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.
 
* position
 
* position
* orientation
+
** '''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 ommited.
  
 
== Syntax ==
 
== Syntax ==
  
 
<pre>
 
<pre>
Syntax Goes Here
+
<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>
 
</pre>
 
</pre>
  

Revision as of 16:56, 20 October 2006

Light Tag Reference

Back To XML 3D Main Page

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).

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 eing 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 ommited.

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