POV-Ray : Newsgroups : povray.general : Volume of a 3d mesh : Re: Volume of a 3d mesh Server Time
10 Aug 2024 13:25:33 EDT (-0400)
  Re: Volume of a 3d mesh  
From: Greg M  Johnson
Date: 10 Dec 1999 09:13:00
Message: <385109B2.C7393E5D@my-dejanews.com>
Boy, you are a math whiz!  But I'm slightly confused in your notation, it's
almost as if you wrote three matrices instead of one. By "determinant of
this matrix", you mean:

                        A.x * B.y * C.z  + .....

Will pov or one of your macros do this calc for me?

John VanSickle wrote:

> Greg M. Johnson wrote:
> >
> > Is there an automatic way to calculate the volume of a 3d mesh?
>
> For each triangle, take the following matrix:
>
> [A.x  A.y  A.z]
> [B.x  B.y  B.z]
> [C.x  C.y  C.z]
>
> Where A, B, and C are the vertices of the triangle.  Make sure that
> the order from A to B to C goes in the same direction for each triangle
> (either clockwise or counter-clockwise) when viewed from the outside
> of the mesh.
>
> Take the determinant of this matrix.  Divide it by six.  If the
> determinant is negative, leave it that way.
>
> Add up all of the determinants for all of the triangles.  Divide by
> six.  If the sum is negative, make it positive.  The result is the
> volume of the mesh.
>
> Note that every edge *MUST* be shared by exactly TWO triangles, or the
> sum will be entirely meaningless.
>
> Hope this helps,
> John
> --
> ICQ: 46085459


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.