• Create Account

### #ActualIgnifex

Posted 06 August 2012 - 10:44 AM

I think the reason that you are struggling is mainly because you do not have sufficient information on the trajectory. Besides the direction of the line, there is a freedom of movement in the rotation around the line. For instance, you could imagine a plane doing a "barrel roll" while staying on the same trajectory line, resulting in a nice double helix like effect for what you want to achieve.
Seeing as how you want to follow a vehicle, I would advice storing the complete transformation per point, instead of just the position. If you only want to reproduce this effect, then adding a "side" vector would be sufficient.

Imagine adding a small XYZ axis system on each point pi in your trajectory, where one vector f points in the direction the vehicle is headed, one vector u points up from your vehicle and the third vector s points to the left (or right) side of the vehicle. Ideally, these vectors should be normalized. If you have trouble obtaining them, please let us know.
Given these vectors, finding the points along the sides of your trajectory is suddenly trivial: Li = pi + a s, and Ri = pi + a s, for Left and Right, where a is half the width of the trajectory.
The order for the triangle strip would then look something like: L 0 - R0 - L1 - R1 - L2 - R2 - etc...

Hope it's a little clear.

### #1Ignifex

Posted 06 August 2012 - 10:43 AM

I think the reason that you are struggling is mainly because you do not have sufficient information on the trajectory. Besides the direction of the line, there is a freedom of movement in the rotation around the line. For instance, you could imagine a plane doing a "barrel roll" while staying on the same trajectory line, resulting in a nice double helix like effect for what you want to achieve.
Seeing as how you want to follow a vehicle, I would advice storing the complete transformation per point, instead of just the position. If you only want to reproduce this effect, then adding a "forward" and a "side" vector would be sufficient.

Imagine adding a small XYZ axis system on each point pi in your trajectory, where one vector f points in the direction the vehicle is headed, one vector u points up from your vehicle and the third vector s points to the left (or right) side of the vehicle. Ideally, these vectors should be normalized. If you have trouble obtaining them, please let us know.
Given these vectors, finding the points along the sides of your trajectory is suddenly trivial: Li = pi + a s, and Ri = pi + a s, for Left and Right, where a is half the width of the trajectory.
The order for the triangle strip would then look something like: L 0 - R0 - L1 - R1 - L2 - R2 - etc...

Hope it's a little clear.

PARTNERS