Home>
The parallel light source illuminates the light as shown in the image below. Since I want to know the direction of the light, I want to visualize the direction of mDirection, so I made two coordinates appropriately from the vector and points A to B? I want to draw a line towards. What should i do?
struct DirectionLight
{
glm :: vec3 mDirection;// direction of light
glm :: vec3 mDiffuseColor;// Diffuse color
glm :: vec3 mSpecColor;// Specular color
};

Answer # 1
Related articles
 c ++  i want to know the difference between the light information of the vertex information and the material information direct
 c ++  i want to know how to find the vector that represents the direction of the rotation axis
 c ++  on the problem of threedimensional arrays
 c ++  i want to convert coordinates by multiplying xyz direction vector by matrix
Related questions
 c ++  when the opengl screen size changes, i want to correct the drawing position and redraw
 c ++  the amount of rotation is getting smaller, and eventually it sticks to the origin
 c ++  i have prepared a world coordinate transformation and a view projective transformation matrix, but i would like to know w
 c ++  i want to know which matrix should be used in the shader for quartermion rotation arbitrary axis rotation matrix can rodr
 c ++  opengl vertex color cannot be implemented i want to know the cause and remedy
 c ++  vertex cannot be drawn in the center of the screen with normalized device coordinates
 c ++  it seems to be a memory leak, but i just don't know the location cause and location
 c ++  how to receive characters in opengl homebrew window
 c ++  no wide characters are drawn
 c ++  drawing stops after standing for 10 seconds
One side (A) is placed at the origin of the coordinate system or at the center of the display.
B,
B = A + suitable value (length) * (representing the direction in which the light source exists) vector
You can comb it.Since it is difficult to distinguish between the two endpoints with a "line",
Instead, it may be better to show the direction by making a "thin triangle" look like an arrow.
In that case, another vertex C, for example,
A vector orthogonal to the "vector (representing the direction in which the light source exists)"
V
UsingC = B + Appropriate value (smaller value) * V
You should prepare it appropriately.