<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[GMan's Mods & Stuff — Directional Lighting?]]></title>
	<link rel="self" href="https://gprogs.com/extern.php?action=feed&amp;tid=67&amp;type=atom" />
	<updated>2006-08-22T00:16:08Z</updated>
	<generator>PunBB</generator>
	<id>https://gprogs.com/viewtopic.php?id=67</id>
		<entry>
			<title type="html"><![CDATA[Re: Directional Lighting?]]></title>
			<link rel="alternate" href="https://gprogs.com/viewtopic.php?pid=401#p401" />
			<content type="html"><![CDATA[]]></content>
			<author>
				<name><![CDATA[gman]]></name>
				<uri>https://gprogs.com/profile.php?id=2</uri>
			</author>
			<updated>2006-08-22T00:16:08Z</updated>
			<id>https://gprogs.com/viewtopic.php?pid=401#p401</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Directional Lighting?]]></title>
			<link rel="alternate" href="https://gprogs.com/viewtopic.php?pid=399#p399" />
			<content type="html"><![CDATA[<p>I still need to create a Directional Light. I have gotten a light to show.<br />If I use the Point or Directional Light, the light does&#039;nt appear at the correct position or rotation. Also the specular and diffuse colors don&#039;t show, only the ambient.<br />The Blide IDE returns &quot;Invalid Directionial Light Direction&quot; but still executes.<br />What could be wrong with my code?<br /></p><div class="codebox"><pre><code>&#039;Add Directional Light
Local LightNode:T_irrILightSceneNode = Scene.addLightSceneNode()
Local Light:T_irrSLight = LightNode.getLightData()
Light.setType(ELT_DIRECTIONAL)
Light.getAmbientColor().set(.5, .7, .5)
Light.getDiffuseColor().set(0, .5, 0)
Light.getSpecularColor().set(.5, .5, 1)
Light.getPosition().set(0, 0, 10)
&#039;light.setRadius(30)</code></pre></div>]]></content>
			<author>
				<name><![CDATA[HondaDirtBiker]]></name>
				<uri>https://gprogs.com/profile.php?id=5</uri>
			</author>
			<updated>2006-08-19T17:07:34Z</updated>
			<id>https://gprogs.com/viewtopic.php?pid=399#p399</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Directional Lighting?]]></title>
			<link rel="alternate" href="https://gprogs.com/viewtopic.php?pid=381#p381" />
			<content type="html"><![CDATA[<p>there is unfortunately no access to the angles.&nbsp; there are only two native light types in Irrlicht, point and directional.&nbsp; for directional, the position of the light is the vector the light is coming from.&nbsp; point emits light in all directions, but only for the radius the light is set at.&nbsp; use setRadius() to set the radius.&nbsp; to get at the colors, you need to use the get() methods on SLight.<br /></p><div class="codebox"><pre><code>Method getAmbientColor:T_irrSColorf()
Method getDiffuseColor:T_irrSColorf()    
Method getSpecularColor:T_irrSColorf()</code></pre></div><p>you then use the returned T_irrSColorf to set the values.&nbsp; so it looks something like:<br /></p><div class="codebox"><pre><code>light.getAmbientColor().set(.4,0,.8)</code></pre></div><p>HTH!&nbsp; love seeing folks using Irrlicht <img src="https://gprogs.com/img/smilies/smile.png" width="15" height="15" alt="smile" /></p>]]></content>
			<author>
				<name><![CDATA[gman]]></name>
				<uri>https://gprogs.com/profile.php?id=2</uri>
			</author>
			<updated>2006-07-24T11:51:01Z</updated>
			<id>https://gprogs.com/viewtopic.php?pid=381#p381</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Directional Lighting?]]></title>
			<link rel="alternate" href="https://gprogs.com/viewtopic.php?pid=379#p379" />
			<content type="html"><![CDATA[<p>I need more help. How would I set the angles and colors? I could only get as far as you showed me.<br /></p><div class="codebox"><pre><code>&#039;Create Directional Light
Local Light:T_irrSLight=T_irrSLight.Create()
Video.addDynamicLight(Light)
Light.setType(ELT_DIRECTIONAL)</code></pre></div>]]></content>
			<author>
				<name><![CDATA[HondaDirtBiker]]></name>
				<uri>https://gprogs.com/profile.php?id=5</uri>
			</author>
			<updated>2006-07-23T13:27:16Z</updated>
			<id>https://gprogs.com/viewtopic.php?pid=379#p379</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Directional Lighting?]]></title>
			<link rel="alternate" href="https://gprogs.com/viewtopic.php?pid=363#p363" />
			<content type="html"><![CDATA[<p>ill see if i can take a more thorough look tonight.&nbsp; as for the last bit of code, you need to create an instance of T_irrSLight before you can use it.&nbsp; to do that, use the create() function on the type.&nbsp; so change your code to:<br /></p><div class="codebox"><pre><code>&#039;Add Directional Light (white)
Local Light:T_irrSLight=T_irrSLight.create()
Video.addDynamicLight(light)
light.setType(ELT_DIRECTIONAL)</code></pre></div>]]></content>
			<author>
				<name><![CDATA[gman]]></name>
				<uri>https://gprogs.com/profile.php?id=2</uri>
			</author>
			<updated>2006-07-10T15:00:09Z</updated>
			<id>https://gprogs.com/viewtopic.php?pid=363#p363</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Directional Lighting?]]></title>
			<link rel="alternate" href="https://gprogs.com/viewtopic.php?pid=361#p361" />
			<content type="html"><![CDATA[<p>I tried some different code that seemed right. When I run it I get a &quot;Unhandled Exception:Attempt to access field or method of Null object&quot;.</p><p>How do I setup the light handle for a dynamic light?<br /></p><div class="codebox"><pre><code>&#039;Add Directional Light (white)
Local Light:T_irrSLight
Video.addDynamicLight(light)
light.setType(ELT_DIRECTIONAL)</code></pre></div><p>Thank you.</p>]]></content>
			<author>
				<name><![CDATA[HondaDirtBiker]]></name>
				<uri>https://gprogs.com/profile.php?id=5</uri>
			</author>
			<updated>2006-07-09T05:38:44Z</updated>
			<id>https://gprogs.com/viewtopic.php?pid=361#p361</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Directional Lighting?]]></title>
			<link rel="alternate" href="https://gprogs.com/viewtopic.php?pid=356#p356" />
			<content type="html"><![CDATA[<p>How would I set the light type and change the SLight structure?<br />This is some code I thought would work.<br /></p><div class="codebox"><pre><code>&#039;Add Directional Light (white)
Local Light:T_irrISceneNode = ..
    Env.addLightSceneNode (Null, T_irrVector3df.createFromVals (0, 0, -40), ..
    T_irrSColorf.createFromRGBA (1.0, 1.0, 1.0, 1.0),ELT_DIRECTIONAL)</code></pre></div><p>BTW, gman your awesome!</p>]]></content>
			<author>
				<name><![CDATA[HondaDirtBiker]]></name>
				<uri>https://gprogs.com/profile.php?id=5</uri>
			</author>
			<updated>2006-06-30T02:02:37Z</updated>
			<id>https://gprogs.com/viewtopic.php?pid=356#p356</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Directional Lighting?]]></title>
			<link rel="alternate" href="https://gprogs.com/viewtopic.php?pid=295#p295" />
			<content type="html"><![CDATA[<p>greetings <img src="https://gprogs.com/img/smilies/smile.png" width="15" height="15" alt="smile" />&nbsp; there should be nothing in the mods that would limit the lights to only point.&nbsp; could you paste some code?&nbsp; the default light is a point light.&nbsp; you will need to alter the SLight structure associated with the light scene node and set the light type to ELT_DIRECTIONAL.&nbsp; after that, the position vector in the SLight structure is now the direction vector so use that to set the direction the light is coming from.&nbsp; i believe this is different than using setPosition on the light scene node.&nbsp; that will only reposition the light itself.</p>]]></content>
			<author>
				<name><![CDATA[gman]]></name>
				<uri>https://gprogs.com/profile.php?id=2</uri>
			</author>
			<updated>2006-04-01T16:11:05Z</updated>
			<id>https://gprogs.com/viewtopic.php?pid=295#p295</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Directional Lighting?]]></title>
			<link rel="alternate" href="https://gprogs.com/viewtopic.php?pid=294#p294" />
			<content type="html"><![CDATA[<p>Irrlicht 0.14.0 has directional lighting. I cant get it to work with the mods though.<br />Was it added since 0.13.0?</p>]]></content>
			<author>
				<name><![CDATA[HondaDirtBiker]]></name>
				<uri>https://gprogs.com/profile.php?id=5</uri>
			</author>
			<updated>2006-04-01T06:15:53Z</updated>
			<id>https://gprogs.com/viewtopic.php?pid=294#p294</id>
		</entry>
</feed>
