Results 1 to 2 of 2

Thread: Light

  1. #1
    Junior Member
    Join Date
    May 2018
    Posts
    4

    Light

    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. #2
    Hope you are not a spam bot, I'm not sure

    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Proudly hosted by Digital Ocean