Thanks much, now it makes sense, and I don't like using code I don't understand. Vector math seems like magic sometimes! Method used in: (link to project)">(link to project)
(vector dot normal) is the length of the component of the vector that points in the same direction as the normal, if vector was pointing away from the intersection point. (vector dot normal) * normal calculates a point with that length above the intersection point, which is half way way between the incoming vector and the reflection vector. If you use vector subtraction then you get a vector from the end of the incoming vector to the center point. That would be half of the yellow line. Multiply by two and add back to the incoming vector. The reduction can be seen here: (link to forums)">(link to forum)
Nice tutorials! I pulled out my Calculus book to review Vectors (at one time, I had a good grasp!). I haven't been able to visualize WHY the reflection vector is 2*VdotNormal*NormalVector-Original. Do you have time for a demo of WHY?
Comments
You need to be logged in to post comments
Add a Comment
I dont get this...
Thanks much, now it makes sense, and I don't like using code I don't understand. Vector math seems like magic sometimes! Method used in: (link to project)">(link to project)
(vector dot normal) is the length of the component of the vector that points in the same direction as the normal, if vector was pointing away from the intersection point. (vector dot normal) * normal calculates a point with that length above the intersection point, which is half way way between the incoming vector and the reflection vector. If you use vector subtraction then you get a vector from the end of the incoming vector to the center point. That would be half of the yellow line. Multiply by two and add back to the incoming vector. The reduction can be seen here: (link to forums)">(link to forum)
Nice tutorials! I pulled out my Calculus book to review Vectors (at one time, I had a good grasp!). I haven't been able to visualize WHY the reflection vector is 2*VdotNormal*NormalVector-Original. Do you have time for a demo of WHY?
Illustration for discussion in the forums (link to forums)">(link to forum)