Q:

Get points along a vector

So I'm essentially trying to do this
say I have
float Origin[3] = {x1, y1, z1}, EndOrigin[3] = {x2, y2, z2};
I want to get n points along a line in three dimensions like this.
I'm trying to do this without using a vector class, just arrays. I do not know a lot about trig, so this is a little tough for me. Any help or pointers?

A:

The points on the line segment are
{ t*x1 + (1-t)*x2, t*y1 + (1-t)*y2, t*z1 + (1-t)*z2 }

where t is any number in the range [0, 1]. You want n points, so just pick n values between zero and one for t and substitute in the formula above.

