Results 1 to 10 of 14

Thread: Ray and convex polygon intersection

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    why not do this:
    p0 = 0;
    p1 = Count div 3;
    p2 = Count * 2 div 3;
    this will give you an even spread of plane base points across the entire polygon.
    btw in your example this will give you exactly the same points as you have on the right picture.

  2. #2
    You're really good at math, and thanks again It wasn't straightforward to come up with pattern that cover all polygon sizes, including triangles.

    The function works fine with triangles still, and it's now in use in the editor too. I hope the (0, 1, 2) vertices weren't necessary somehow for your projection formula, would guess no. Regards to projection, what did it actually do? It transforms vertices to plane of face normal's space? (that sounded weird) It's cool idea, and i noticed immediately how few calculations it's doing. Definitely much much faster than if dealing with normal way like 3D ray-triangle. Kind of genious.

  3. #3
    yes that's pretty much how it works. all the vertices of the polygon and the intersection point are on the same plane, so project them and work with 2d instead of 3d.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •