Results 1 to 5 of 5

Thread: Mesh Intersecton

  1. #1
    Member Contributor
    Join Date
    Mar 2008
    Posts
    91

    Mesh Intersecton

    I have a vrml model (wml file) that I need to shoot some rays at to get the distance from a point (similar to ray tracing, but i just need the coordinates of the intersection, nothing about the light). Do I have to determine the intersection of the ray with every triangle in the mesh, then take the closest one? or is there a better way to do this?

    Thanks,

    Dave

  2. #2

  3. #3
    Member Contributor
    Join Date
    Mar 2008
    Posts
    91

    Re: Mesh Intersecton

    Right right, I am familiar with some of those methods for determining if a ray intersects a triangle, but if I am shooting thousands of rays at a mesh made of thousands of triangles, it seems like there should be some built in method of intersecting a ray with the whole mesh, ie.

    Ray.Intersect(Mesh)

    or something, so I don't have to implement the actual loop to go through the triangles. Am I way off base here?

    Thanks,

    Dave

  4. #4
    Senior Member Frequent Contributor
    Join Date
    Apr 2000
    Location
    Melbourne,Victoria,Australia
    Posts
    748

    Re: Mesh Intersecton

    You can optimize the process by first testing against the Bounding box (or sphere) of each object. You could also implement something like an Oct Tree to "split up" your mesh (so you test against the various levels of the Oct tree until you get to the lowest level, then you test against the poly's in that Oct Tree). But ultimately, if you want to know where your ray hits your mesh, then you'll have to test against each of the poly's in the mesh. The only "built in" method is to use Picking (which I've never done) - but that has it's own set of issues when dealing with individual poly's (as I understand it).

  5. #5
    Member Contributor
    Join Date
    Mar 2008
    Posts
    91

    Re: Mesh Intersecton

    Does anyone have/know where I can get some canned c++ code to do some of this stuff (loading an obj file, triangle intersection, mesh intersection, etc)?

Similar Threads

  1. Interpolating between mesh keyframes causes mesh to break
    By soulfoam in forum OpenGL: Advanced Coding
    Replies: 2
    Last Post: 01-19-2019, 10:34 PM
  2. Static Mesh and Dynamic mesh
    By DragonForce99 in forum OpenGL: Advanced Coding
    Replies: 0
    Last Post: 06-18-2014, 02:01 AM
  3. Replies: 1
    Last Post: 05-18-2014, 12:34 PM
  4. Single mesh versus array of mesh
    By DannySaucen in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 02-06-2012, 08:44 AM
  5. Replies: 2
    Last Post: 05-04-2005, 07:28 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Proudly hosted by Digital Ocean