webgl-fundamentals
webgl-fundamentals copied to clipboard
halfVector in diagram seems to be off
In the diagram the "halfVector" doesn't visually seem right. If I complete the rectangle and get the long vector (surface2view + surface2light vectors), then half of that doesn't not align with the rendered "halfVector".
You're not adding the vectors, you're adding the direction of the vectors. In other words you add the normalized vectors, not the vectors themselves to get the halfVector.
The simplest update might just be to change it from
If we know the direction from the surface of our model to the light (which we do since we just did that). And if we know the direction from the surface to view/eye/camera, which we can compute, then we can add those 2 vectors and normalize them to get the halfVector
to
If we know the direction from the surface of our model to the light (which we do since we just did that). And if we know the direction from the surface to view/eye/camera, which we can compute, then we can add those 2 directions and normalize the result to get the halfVector. Note: by direction I mean the normalized values of the 2 vectors,
surface2View
andsurface2Light
.
Or something simple like that. I don't want to add paragraphs of text if it's not needed.
I think
Note: by adding those 2 directions I mean adding the normalized values of each of the 2 vectors, surface2View and surface2Light.
sounds good, with the rest the same. 👍