Cross Products

I won’t get into much detail here other than to talk about a few example of why you would want to calculate vector cross products and briefly explain what they are. Wikipedia has a great entry on them which will explain all the math behind them.

Given two vectors, for instance, two sides of a triangle, the cross product will give you a vector that points perpendicular to those vectors.  This has many uses in 3D animation. You can calculate surface area (1/2 the magnitude of the cross product of vectors of two sides of a triangle will give you the area of that triangle). You can calculate surface normals, which show which direction the polygons of your surface are pointing.  You can use cross products to align sprites to the camera or cull geometry that is pointing away from the camera.  One thing I used cross products for recently was in a particle setup where I needed to create an aura around a character.  I was able to figure out which surfaces of the geometry were pointing perpendicular to the camera and use that as a basis for particle emission.  So, many uses.

Advertisements

One thought on “Cross Products

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s