Results 1 to 2 of 2

Thread: Light

  1. #1
    Junior Member Newbie
    Join Date
    May 2018
    Posts
    6

    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
    Member Contributor
    Join Date
    Dec 2015
    Posts
    74
    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

Similar Threads

  1. What's different between ambient light and diffuse light,?
    By reader1 in forum OpenGL: Basic Coding
    Replies: 11
    Last Post: 06-12-2015, 08:41 AM
  2. How to add a light if white ambient light is active?
    By FedorSymkin in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 11-21-2014, 03:40 PM
  3. Positioned spot light - white light appearing from nowhere behind
    By windchine in forum OpenGL: Basic Coding
    Replies: 9
    Last Post: 08-03-2012, 02:30 AM
  4. Fixed light and moving spot light with the mouse
    By Jorcelangelo in forum OpenGL: Basic Coding
    Replies: 0
    Last Post: 04-18-2012, 09:56 PM
  5. Point light VP -> Spot light VP: ?
    By Freelancer in forum OpenGL: Advanced Coding
    Replies: 1
    Last Post: 01-27-2004, 11:43 AM

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