## Segmented line in 3D space

### Segmented line in 3D space

Given a two points with the following structure:

struct
{
float fx, fy, fz; /* 3D coordinate */
int sx, sy;      /* projected 2D corrdinate */

Quote:}

P1, P2;

How can I I draw a line between the the points, using multiple segments,
each one colored according to the value of 'z' at that point?

--
Alan McFarlane

### Segmented line in 3D space

(question xposted to comp.graphics.algorithms)

> Given a two points with the following structure:

> struct
> {
>   float fx, fy, fz; /* 3D coordinate */
>   int sx, sy;      /* projected 2D corrdinate */
> }
> P1, P2;

> How can I I draw a line between the the points, using multiple segments,
> each one colored according to the value of 'z' at that point?

> --
> Alan McFarlane

I am creating my own graphics library that does alpha-blending,
anti-aliasing, tri-linear buffering, and all that stuff (software based)....

My only problem is I need to know how to rotate around the objects center,
so i need to know how to rotate around the center of a triangle!! Right now,
it is rotating around the origin and looks horrible.

Does anyone know how to find the center point of a triangle from the
coordinates of 3 vertices?? And does anybody know the formula (without
matrices! !yikes!) to rotate an object around a specific point? Like if i
wanted to rotate a triangle around point (2,2,1)??  [x,y,z]