Archived

This topic is now archived and is closed to further replies.

bigyellowtoe

what's difference between a vertex and vector?

Recommended Posts

to combine the already correct previous posts:
a "vertex" is what is commonly known as a point in space, though that is not the technical defn, i don''t think.
and a "vector" has magnitude and direction.

crazy166
some people think i'm crazy, some people know i am

Share this post


Link to post
Share on other sites
A vertex is just a point in space, (10, 3, -42) for example. A vector on the other hand has direction and length. So if we have (10, 3, -42) and treat it as a vector it has a direction, it points to the right, up and into the screen(in OpenGL's coordinate system). That vector also has a length of 43.278170 which tells you how long the vector is. When you normalize a vector you will get a unit vector, a vector whose length is 1. Hope this helps.

Nate Miller
http://nate.scuzzy.net


Edited by - Nate on October 4, 2000 3:36:19 PM

Share this post


Link to post
Share on other sites
A vertex is the point where two line meet, yes, and a vector is similar to a ray, with origin, direction, and magnitude.

-------------------------------
That's just my 200 bucks' worth!

..-=gLaDiAtOr=-..

Share this post


Link to post
Share on other sites
A vertex and a vector can use the same structure(float x, float y, float z). The distinction between vertex and vector depends on how you use the structure.

Nate Miller
http://nate.scuzzy.net

Share this post


Link to post
Share on other sites
A vertex is a point. Just a point nothing else.
Whereas a vector has a direction and length.
Think of a vector as a force.

But most of the time you can interchange the two and get the same results. But keeping them separated when thinking about them helps keep you sane

So when coding/implementing use tons of typedefs and don''t recycle your structures...
ie typedef point vector

Share this post


Link to post
Share on other sites
often a vertex is used by models, for example a cube has vertexes (8), and you could move it around with vectors

vertexes often have more infos than just x,y,z, for example a color, or texture coordinates, or even a normal-vector "on it", for lighting-calculations



we wanna play, not watch the pictures

Share this post


Link to post
Share on other sites
ohh. and vectors are mathematical defined things

vertexes are just things, programmers have defined themselfes

we wanna play, not watch the pictures

Share this post


Link to post
Share on other sites
though they mean mathmatically different things u normally use the same class for them in 3d grafixs, i normally call everything in me program VECTORS even though some are vertices if u wanna be a bit more correct u could go

struct VECTOR{
float x,y,z;

VECTOR (float xx, float yy, float zz) { x=xx; y=yy; z=zz; }
VECTOR operator+(VECTOR &pVec) { return VECTOR(x + pVec.x, y + pVec.y, z + pVec.z);}

};

typedef VECTOR VERTEX;

VERTEX point(0,0,0);
VECTOR velocity(0,10,10);

VERTEX newposition = point+velocity;

Share this post


Link to post
Share on other sites