What's the difference between a vector and a vertex?

lesderid picture lesderid · May 17, 2012 · Viewed 8.6k times · Source

I often see the words 'vector' and 'vertex' (plural 'vertices') being used in 3D programming contexts.

From what I can tell, they both describe a point in n-dimensional space. The XNA framework for example has Vector2, Vector3 and Vector4 classes, but there doesn't seem to be a Vertex class.

What is the exact difference between a vector and a vertex?

Answer

user197015 picture user197015 · May 17, 2012

A 'vector' is a mathematical concept; crudely, it represents a displacement in some coordinate space. A vertex is an element of some 3D (or 2D, really) geometry which typically has a position and some other attributes (color, texture coordinates, et cetera).

The position of a vertex (and thus sometimes the vertex itself) can be represented by a vector if one assumes the vector is a displacement from the origin of the coordinate system. Sometimes people call this representation of a vector a "position vector."

So, roughly, the difference is that vectors can be used to describe (in full or in part) a vertex.