Results 1 to 5 of 5

Thread: how to compute volume of a set of points in space

  1. #1
    Junior Member Newbie
    Join Date
    Jun 2006
    Location
    Germany
    Posts
    3

    how to compute volume of a set of points in space

    Hello.
    I am new to Opengl and graphical/geometric algorithms.
    How can i compute the volume of a given set of points in space.

    Do i have to do a triangulation, compute the volumes of the single tetraeders and unify the results to one big volume ?
    Or is there a better approach ?

    THX

  2. #2
    Guest

    Re: how to compute volume of a set of points in space

    Your problem statement is underconstrained. What do you me by "a set of points in space?"

    For convex polyhedrons, summing tetrahedrons is just fine.

    What does this have to do with OpenGL?

  3. #3
    Junior Member Newbie
    Join Date
    Jun 2006
    Location
    Germany
    Posts
    3

    Re: how to compute volume of a set of points in space

    Ok, its not opengl-specific.
    But where else should i post it ? I need it in my OpenGL-application....

    Ok again( Is it so hard to understand ?):

    1) You have a set of points
    2) You connect them all to an object
    3) How can i compute the volume now ?




    thx

  4. #4
    Super Moderator OpenGL Lord
    Join Date
    Dec 2003
    Location
    Grenoble - France
    Posts
    5,574

    Re: how to compute volume of a set of points in space

    You know, there is a math and algos section here .

    Step 2 is non trivial, different valid solutions can exist for the same set of points.

    s03 already gave you a good answer. For non convex, split your volume into multiple convex parts.

  5. #5
    Member Contributor
    Join Date
    Jun 2006
    Posts
    97

    Re: how to compute volume of a set of points in space

    Assuming you can form convex polyhedrons from your points in space, you can calculate the volume of those polyhedrons by selecting a single vertex from the polyhedron as the apex, then forming tetrahedrons with the triangles in the other polygons, one at a time, summing the volumes as you go.

    The volume of a single tetrahedron is V = 1/3 * area of triangle * height, which can also be written as V = 1/6 * dot(H, cross(V2,V1)), where H is the vector from polygon point P0 to the apex, apex - P0, and V1, V2 are the vectors Pi+1 - P0, Pi+2 - P0, respectively, with i in [0, n-2) (Pi are the points of the current polygon and n is the total number of points).

    Keep in mind volumes can produce some very large numbers so double precision may be advisable depending on the scale of things. You could also simply scale all volumes by a small number to avoid overflow, while still maintaining equivalent relative proportions.

    As Zbuffer pointed out, tesselation of the space is probably going to be the hard part of this assignment.

Similar Threads

  1. Compute cornners of pixels in world space?
    By __bob__ in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 11-16-2015, 08:19 AM
  2. Compute eye space coord from window space coord?
    By karx11erx in forum OpenGL: Advanced Coding
    Replies: 55
    Last Post: 04-20-2011, 02:41 AM
  3. How to compute the light position in screen space?
    By nicolasbol in forum OpenGL: GLSL
    Replies: 13
    Last Post: 12-30-2008, 12:09 PM
  4. volume of N points in space
    By alp17 in forum OpenGL: Advanced Coding
    Replies: 5
    Last Post: 11-25-2003, 12:07 PM
  5. Clip space volume in opengl
    By jonasmr in forum OpenGL: Advanced Coding
    Replies: 2
    Last Post: 10-29-2003, 09:45 AM

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