Light


#1

In my Collada file I have spot light node like below:

  <node id="Spot" name="Spot" type="NODE">
    <matrix sid="transform">0.7071068 0.5 0.5 19.21265 0 0.7071068 -0.7071068 -13.2096 -0.7071068 0.5 0.5 7.94665 0 0 0 1</matrix>
    <instance_light url="#Spot-light"/>
  </node>

From this node how can i get the vec3 cone direction and light position?

The light’s default direction vector in local coordinates is [0,0,-1], pointing down the -Z axis. The actual direction of the light is defined by the transform of the node where the light is instantiated. Should i have to multiply cone default direction (0,0,-1) with my spot light transform matrix. How to get light_position from the rotation added matrix?

Thanks.


#2

Hope you are not a spam bot, I’m not sure :slight_smile:

Yes default light direction is as what you described (0,0,-1).

The actual direction of the light is defined by the transform of the node where the light is instantiated

Actually you already answered your question here. You must apply light transform to that direction to get actual (or transformed) direction. You can only apply rotation part because you only need to direction.

You can get position from light transform in world space