Tag Info

New answers tagged

1

To find the normal, you can use the cross product of three of the points in the polygon. Create two vectors from those three points and find the cross product of those. To find the intersection of the ray with the polygon, you will first need to ensure it intersects with the plane of the polygon. To do this, you will need to do some algebraic manipulation ...


1

If assume that your code works properly, the easiest solution is to select correct normal from these two ones. You can do this just by calculating the dot product of the ray vector and the normal. If the result is negative, than this is the normal you are looking for. For example: Vector2 ray; ray = r1 - r0; float result; //if result < 0 than the ...



Top 50 recent answers are included