Skip to content

Vector projections

Vector projections sop-dot-projection

Vector projection is a powerful tool in VFX and 3D graphics, allowing us to determine how much of one vector "shadows" or projects onto another vector. This can be useful in a variety of contexts, such as aligning objects, calculating forces, or understanding the relationship between different vectors in space.

The formula for vector projection is:

$$ \huge\mathbf{c} = (\mathbf{a} \cdot \hat{\mathbf{b}}) \hat{\mathbf{b}} $$

VEXpression
vector c = dot(a, normalize(b)) * normalize(b);