|
|
Volume of a mesh
Hello,
I have been looking for an easy way to use opengl to calculate the
volume of a mesh. From what I understand is that if I have a mesh and know
all of the dimensions I should be able to calculate the volume. This is a o
brainer for a cube or other simple primitive, but how can I calculate the
volume of a more complex mesh, without explicitly storing all of the
information alongside it.
Say I want to calculte the volume of a cube, That's simply length *
width * height. But if I wanted to know the volume of an axe head that I
modeld I have to take the wedge of half of the head in to account as well as
the curve at the same time. Does OpenGL have any functions to help with this
or is there an easy way to implement a calculation that would work on any
mesh?
I'm doing this as a learning exercise and it seems like it would be very
doable for a novice like myself.
I tried searching google but all I get is stuff about volume rendering.
Although very interesting, it dosen't seem to be what I am looking for.
Thanks for reading.
|
|
0
|
|
|
|
Reply
|
brentritchie (17)
|
8/28/2005 4:48:37 PM |
|
Brent Ritchie wrote:
> Hello,
>
> I have been looking for an easy way to use opengl to
> calculate the
That's not the purpose of OpenGL. Ask in
comp.graphics.algorithms.
Wolfgang Draxinger
--
|
|
0
|
|
|
|
Reply
|
Wolfgang
|
8/28/2005 5:55:58 PM
|
|
--
"Brent Ritchie" <brentritchie@personainternet.com> wrote in message
news:11h3qn6jsrapdbd@corp.supernews.com...
> I have been looking for an easy way to use opengl to calculate the
> volume of a mesh. From what I understand is that if I have a mesh and know
> all of the dimensions I should be able to calculate the volume. This is a
> o
> brainer for a cube or other simple primitive, but how can I calculate the
> volume of a more complex mesh, without explicitly storing all of the
> information alongside it.
If your mesh forms a closed, simple polyhedron, then you can
compute the volume as a sum of signed volumes of tetrahedra,
all tetrahedra sharing a common origin (any point you wish)
with the opposite triangle a facet of the polyhedron. The
pseudocode here assumes the mesh triangles are counterclockwise
ordered when viewed from outside the mesh.
volume = 0;
for (i = 0; i < numTriangles; i++)
{
V0 = vertex 0 of triangle i;
V1 = vertex 1 of triangle i;
V2 = vertex 2 of triangle i;
volume += Dot(V0, V1.Cross(V2));
}
volume /= 6;
The mesh triangle <V0,V1,V2> is counterclockwise ordered when
viewed from outside the mesh.
|
|
0
|
|
|
|
Reply
|
wasting
|
8/29/2005 12:11:16 AM
|
|
"Wolfgang Draxinger" <wdraxinger@darkstargames.de> wrote in message
news:eea9u2-21p.ln1@darkstargames.dnsalias.net...
> Brent Ritchie wrote:
>
> > Hello,
> >
> > I have been looking for an easy way to use opengl to
> > calculate the
>
> That's not the purpose of OpenGL. Ask in
> comp.graphics.algorithms.
>
I kind of figured OpenGL didn't have anything to do this. But I decided
to ask anyway just incase.
Thanks for the appropriate group.
> Wolfgang Draxinger
> --
>
|
|
0
|
|
|
|
Reply
|
Brent
|
8/29/2005 4:54:53 PM
|
|
"wasting time" <wastingtime@whileatwork.com> wrote in message
news:EosQe.3506$_84.913@newsread1.news.atl.earthlink.net...
> --
> "Brent Ritchie" <brentritchie@personainternet.com> wrote in message
> news:11h3qn6jsrapdbd@corp.supernews.com...
> > I have been looking for an easy way to use opengl to calculate the
> > volume of a mesh. From what I understand is that if I have a mesh and
know
> > all of the dimensions I should be able to calculate the volume. This is
a
> > o
> > brainer for a cube or other simple primitive, but how can I calculate
the
> > volume of a more complex mesh, without explicitly storing all of the
> > information alongside it.
>
> If your mesh forms a closed, simple polyhedron, then you can
> compute the volume as a sum of signed volumes of tetrahedra,
> all tetrahedra sharing a common origin (any point you wish)
> with the opposite triangle a facet of the polyhedron. The
> pseudocode here assumes the mesh triangles are counterclockwise
> ordered when viewed from outside the mesh.
>
> volume = 0;
> for (i = 0; i < numTriangles; i++)
> {
> V0 = vertex 0 of triangle i;
> V1 = vertex 1 of triangle i;
> V2 = vertex 2 of triangle i;
> volume += Dot(V0, V1.Cross(V2));
> }
> volume /= 6;
>
> The mesh triangle <V0,V1,V2> is counterclockwise ordered when
> viewed from outside the mesh.
>
>
I have seen this before. But I like your pseudo code example it's
beginning to make more sense. I looked through mathworld and I've got to do
more research on the dot and cross functions for it to make sense.
Thank you.
|
|
0
|
|
|
|
Reply
|
Brent
|
8/29/2005 4:57:39 PM
|
|
|
4 Replies
295 Views
(page loaded in 0.109 seconds)
Similiar Articles: Generating volume coordinates of an irregular polyhedron using ...Hi, I'm not sure whether this is something that Matlab has a built in function for, but if anyone knows of anything that would be really helpful! ... How to create 3D mesh for Sphere - comp.soft-sys.matlabI'd like to create a rectangular mesh of a sphere, and a tetrahedral mesh sphere ... 3D plotting of a partial sphere - comp.soft-sys.matlab I am trying to plot a 3D volume ... Skeleton of a volume (triangulated) - comp.soft-sys.matlab ...Hi all, I want to get a skeleton of a 3D volume. I'm pretty sure I can do this in a round-about way, but I think there might be a shortcut. The ... Volume not found - comp.unix.solarisI'm grateful for those who helped me with the earlier problem of a volume not mounting at boot. Here's a problem involving a volume not visible to th... internal volume of a box? - comp.cad.solidworksHello, is there a way to quickly get an internal volume (of air, for example) that a box (or an assembly that is similar to a box) contains? I belie... CPU or GPU Volume rendering - comp.graphics.visualization ...SBJ: CPU or GPU Volume rendering I'm looking for the collective opinion about feasibility of implementation of high quality interactive "volume ... 3D plotting of a partial sphere - comp.soft-sys.matlabI am trying to plot a 3D volume defined as part of a sphere. The volume is defined by six numbers in spherical coordinates (r, el & az): minimum/maxim... Calculating the volume of a cavity inside an assembly - comp.cad ...Hi, I'm a mechanical engineering student and I've been asked to create a piston on solidworks. I created the whole assembly by building all the requir... Dot and Cross products for Complex Numbers - comp.soft-sys.math ...Volume of a mesh - comp.graphics.api.opengl... but how can I calculate the volume of a more complex ... vertex 2 of triangle i; volume += Dot(V0, V1.Cross(V2 ... API: center of mass calculation of parts in an assembly - comp.cad ...Volume of a mesh - comp.graphics.api.opengl... the volume of a cavity inside an assembly - comp.cad ... ... I am trying to plot a 3D volume defined as part ... surface - Volume of a 3D closed mesh car object - Stack OverflowI have a 3D closed mesh car object having a surface made up triangles. I want to calculate its volume, center of volume and inertia tensor. Could you help me math - How to calculate the volume of a 3D mesh object the surface ...I want to calculate the volume of a 3D mesh object having a surface made up triangles. Could you help me. Thank in advance Best Regards. Can 7/20/2012 9:26:15 PM
|
|
|
|
|
|
|
|
|