Jump to content

question about the "Directional Light"


dav74
 Share

Recommended Posts

Hi,

I've a question about the "Directional Light". In the parameters of this method, we have a "direction" and this direction is a "Vector3" (a 3D point). How make a direction with a only 3D point  (you must have 2 points ?)

Thanx for your help

Link to comment
Share on other sites

This is always a bit complicated to understand when this is the first time you encounter it but with a vector3 you can:

  • Define a position 
  • Define a direction (each component represents the offset for each axis)

 

What do you do when you have two points? You specify a start and a end point. And you can obtain the direction with the following operation:

direction = endPoint - startPoint

or:

(dx, dy, dz) = (ex - sx, ey-sy, ez-sz)

 

Do you see what I mean?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...