The product of vectors used by Shader in Unity


Preface

Dot product of vectors used by Shader in Unity


1. Multiplication of vectors

1. Dot product

2. Difference product


2. Dot product (the result is a scalar)

1. Mathematical representation

Insert image description here

2. Geometric representation

Insert image description here

One sentence summary: Dot product of two vectors = Projection value of one vector on the other vector * Modulus length of the other vector

Note: The dot product of vectors is mainly used in lighting models


3. Cross product

Insert image description here

1. The result of the vector cross product is perpendicular to the two multiplied vectors.

2. Method to judge the positive and negative direction of the result: right-hand rule

The index finger points to the first vector, the middle finger points to the second vector, and the thumb is the direction of the result vector.

Insert image description here

Guess you like

Origin blog.csdn.net/qq_51603875/article/details/133243183