Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 3 of 3

Thread: Finding intersection of a ray with arbitrary surface

  1. #1
    Junior Member Newbie
    Join Date
    Feb 2014
    Posts
    21

    Finding intersection of a ray with arbitrary surface

    I want to check if a user clicked on a surface. In this case the surface is a coons patch.

    What should be the algorithm to finding an intersection of the click point (a ray) with the surface?

  2. #2
    Intern Newbie
    Join Date
    Jul 2014
    Posts
    46
    Maybe you can loop on all the triangles of your surface and use the "raytracing" algorithm. (This is how I do)

  3. #3
    Advanced Member Frequent Contributor
    Join Date
    Apr 2010
    Posts
    873
    Not considering practicality or efficiency you have a surface S(u,v) parameterized by (s,t) and a ray R(u) parameterized by u and you are looking for values s,t,u such that S(s,t) = R(u). In other words you have a system of three equations for three unknowns that you can solve to find the intersection point(s).
    I don't know enough about Coons patches to say if there is a better/different algorithm.

Posting Permissions

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