Jump to content
Posted 05 February 2009 - 03:06 AM
Posted 05 February 2009 - 07:23 AM
Posted 05 February 2009 - 08:26 AM
Posted 05 September 2013 - 04:36 PM
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
Posted 05 September 2013 - 08:39 PM
I think you're missing a second cross product.
Posted 07 September 2013 - 12:50 AM
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"