I am working with a model where I have to calculate a perpendicular to a vector from p1 and p2 (3d) at point p3 on the line joining these points.
The arrangement would be some thing like this p1--------p3---------p2 . Some times this p3 may coincide with p1 or p2.
I know how to calculate a perpendicular vector to vector p1-p2 in general using the dot products and deciding ratios. But how to make it passing through this point p3 ?
I will be calculating in Geometry shader .. !
Any Ideas .. ?