#### Archived

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

# what's difference between a vertex and vector?

This topic is 6347 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Lame question I guess, but if someone can make the distinction for me I''d be happy again thanks

##### Share on other sites
I believe vertex is the origin of a function such as
when you graph y=x^2 the vertex would be (0,0). And a vector is something that has a magnitude and a direction.
I could be wrong but that is what I think.

##### Share on other sites
Isn''t a vertex the point where two lines meet or intersect?

##### Share on other sites
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 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 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!

##### Share on other sites
so you define them as the following?

the_vertex[2] floatx,floaty,floatz
the_vector vertex[0],vertex[1]

is this correct, i''m still confusing myself sorry.

##### 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 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 on other sites
ah smiling again, got it thanks.

. vertex

.----------> vector

##### 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 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 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;