Working with lights

2014-08-17

Working with lights

Permalink 06:24:12 am, Categories: GSoC 2014  

There are several ways to enable lights in Crystal Space. One being from world file (XML). Following is the syntax to lit them in your environment.

1). Point light :-
<light name='Lamp'>
<center y='10' x='0' z='0'/>
<color blue='1.0' green='1.0' red='1.0'/>
<radius>100</radius>
<type>point</type>
<move>
<matrix>
<roty>0</roty>
<rotz>0</rotz>
<rotx>0</rotx>
</matrix>
</move>
</light>

PointLight

2). Directional light :- Same as point. rotate the matrix to change it's direction
<light name='Lamp'>
<center y='10' x='0' z='0'/>
<color blue='1.0' green='1.0' red='1.0'/>
<radius>100</radius>
<type>directional</type>
<move>
<matrix>
<roty>0</roty>
<rotz>0</rotz>
<rotx>-1.57</rotx>
</matrix>
</move>
</light>

DirectionalLight

3). Spot light :- requires some additional values
<light name='Lamp'>
<center y='10.00' x='0' z='0'/>
<color blue='1.0' green='1.0' red='1.0'/>
<radius>200</radius>
<type>spot</type>
<move>
<matrix>
<roty>0</roty>
<rotz>0</rotz>
<rotx>-1.57</rotx>
</matrix>
</move>
<spotlightfalloff outer="50" />
<attenuation>none</attenuation>
<halo>
<type>nova</type>
<seed>0</seed>
<numspokes>100</numspokes>
<roundness>0.5</roundness>
</halo>
</light>

SpotLight

Trackback address for this post:

This is a captcha-picture. It is used to prevent mass-access by robots.
Please enter the characters from the image above. (case insensitive)

Comments, Trackbacks, Pingbacks:

No Comments/Trackbacks/Pingbacks for this post yet...

Comments are not allowed from anonymous visitors.

November 2014
Sun Mon Tue Wed Thu Fri Sat
 << <   > >>
            1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30            

Search

Categories

Misc

XML Feeds

What is this?

powered by
b2evolution