Particle is located in point P0.

It's tail (trace) is located in points: P1, P2, P3, etc...

Camera is located in point C.

I want to draw "line" from P0 to P1, then from P1 to P2, then from P2 to P3,

etc...

However, it can't be just GL_LINES, because its thickness should differ when

particle is far or close to camera.

So I need to construct set of rectangles, based on P0 and P1, then P1 and P2,

then P2 and P3, etc... And draw them with positive alpha inside and alpha=0 on

edges.

The problem is how to do it correctly, so rectangles will be faced directly to

camera. I read tutorials about billboarding, but this time it's not about

rotating objects, but about generating points around "lines", to make

rectangles.

example:

this is part of tail:

P0--------P1

this is rectangle:

A--------B

| |

P0--------P1

| |

D--------C

It's obvious that AD and BC are perpendicular to P0P1.

There is infinite set of vectors which are perp. to P0P1, but only one (?)

which is faced directly to camera.

How to calculate it? :-)

PS. CP0 x P0P1 == AD ?

--

Free Software - find interesting programs and change them

NetHack - meet interesting creatures, kill them and eat their bodies

Usenet - meet interesting people from all over the world and flame them

Decopter - unrealistic helicopter simulator, get it from http://decopter.sf.net