Subscribe to GameDev.net Direct to receive the latest updates and exclusive content.
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.
Posted 13 January 2009 - 10:51 AM
Posted 13 January 2009 - 11:03 AM
Posted 13 January 2009 - 05:20 PM
Quote:
Original post by Pragma
If you already have the triangles, computing the volume is easy. Just loop over all your created triangles, and sum up the quantity dot(v0, cross(v1,v2)) where v0, v1, v2 are the vertices of your triangle.
Posted 13 January 2009 - 06:52 PM
Quote:
Original post by Pragma
If you already have the triangles, computing the volume is easy. Just loop over all your created triangles, and sum up the quantity dot(v0, cross(v1,v2)) where v0, v1, v2 are the vertices of your triangle.
Posted 14 January 2009 - 12:57 AM
Posted 14 January 2009 - 04:17 AM
Quote:
Original post by Pragma
The mesh does not need to be convex, and it doesn't need to enclose the origin. To prove to yourself that this is true, try drawing some examples in 2D on paper. You'll see that sometimes dot(v0, cross(v1,v2)) is negative, but that when all contributions are added up the negative terms cancel with even larger positive terms.
The only requirement is that your mesh has to be closed and your triangles have to be consistently oriented. This should happen automatically with data from marching cubes.
EDIT: It should actually be dot(v0, cross(v1,v2)) / 6
Posted 14 January 2009 - 07:30 AM
Quote:
Original post by Pragma
The mesh does not need to be convex, and it doesn't need to enclose the origin. To prove to yourself that this is true, try drawing some examples in 2D on paper. You'll see that sometimes dot(v0, cross(v1,v2)) is negative, but that when all contributions are added up the negative terms cancel with even larger positive terms.
The only requirement is that your mesh has to be closed and your triangles have to be consistently oriented. This should happen automatically with data from marching cubes.
EDIT: It should actually be dot(v0, cross(v1,v2)) / 6
Posted 14 January 2009 - 01:47 PM
Posted 14 January 2009 - 02:07 PM
Quote:
Original post by Pragma
Do you care about the volume contained in each cell? Or do you just need to know the total volume?
If it's the former then you'll need to use a different trick. But if it's the latter, you can compute dot(v0, cross(v1,v2)) / 6 for all the triangles in each cell and store them in the cell. Then you can add this up for all the cells. You can easily do this in parallel over multiple machines.
Posted 28 February 2012 - 01:15 PM
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.
GameDev.net™, the GameDev.net logo, and GDNet™ are trademarks of GameDev.net, LLC.