Ribbon/billboard trails
The second shows the jagged trail during turns:
I was crossing the segment axis with the camera view direction, but I am now crossing the segment axis with the direction from the segment to the camera - and this corrects both the disappearing and the jagged edges.
Hello, I'm trying to reproduce your method for billboarding trails, but I've some difficulties... You mentionned "Direction constants" :
plus a direction constant indicating left or right side of the strip
Assuming direction of the segment is UnitZ, and the normal of the segment UnitY : direction constants are UnitX for thie left side and -UnitX for the right part ? I mean, these two vectors point outside the segment. But the result is not correct.
Here is how I implemented your description :
but I am now crossing the segment axis with the direction from the segment to the camera
Vector3 dir = Vector3.Normalize(cameraPosition - Position);
Vector3 dir2 = Vector3.Normalize(Vector3.Cross(dir, Direction)); //Direction = UnitZ
I then multiply by the side constant to move either left or right, and add it to the position
Vector3 final = Position + dir2 * OutSideDir; //UnitX
and then multiply by ViewProj matrix
Thank you for your help
I think you're missing a second cross product.
Read this: http://www.gamedev.net/topic/644649-bill-boarding-oriented-rectangle/#entry5072390
OK thank you I managed it, altough I still don't understand why switcoder added "a direction constant indicating left or right side of the strip"