can someone help me understand using vector addition how I can add the first term of three terms and keep going? here's and example if I didn't explain that too well.
X1 X2 X3......X100
and it can be less than 100, 100 is a variable but it is the highest the variable can go
Erm... A loop, maybe?
Originally Posted by mattz714
It might be OK, since this is a 3D vector 'point', to create a vector 'object' first. You can do that using a typedef.
Now, I'm not sure you actually want to add the three dimensions (x, y, z) of a vector together, it's more likely the case that you want to increment (or decrement) certain of the dimensions of each vector point to achieve a translate, scale or rotate on them in a point-relative way.
//this defines a struct of type VPOINT
//this 'creates' a vector point
If you use three of these points to define a shape, say a triangle, you can move the triangle from left to right by incrementing their 'x' values by a fixed amount on subsequent iterations of a loop, drawing connecting lines to show the shape each time (clear the screen between each iteration).
You first have to define each point's position in space relative to each other (normally in Cartesian coordinates, but you can use screen coords as well).
Changing just the 'y' values will make the triangles go up and down, changing the 'z' values will make the triangles move closer or farther away.
When you deal with 1000s of triangles, you can build a complex 3D object that you use matrices to manipulate, these let you operate on all the points at once.
You'll need direct access to your graphics card to handle complex objects, OpenGL can get you started with that.
You might try the Game Programming sig on this board for more info on this stuff because unlike the -points- I used as examples, -vectors- also have 'direction'. You define them exactly the way I show above but you operate on them as 'vectors' rather than 'points' and use pretty basic trig routines to manipulate them through their various transforms. As those transforms get more complex, you can (as I pointed out) use matrices and matrix multiplication to handle the tough stuff.