1

**Support / How to calculate area?**

« **on:**December 13, 2007, 05:14:40 pm »

I've parked my attempt to calculate volume for now, and I'm concentrating on simple areas of polygons instead.

My method is to call (pseudo code)

polyManager.getTransformedVertex(polygon,vertex1)

polyManager.getTransformedVertex(polygon,vertex2)

polyManager.getTransformedVertex(polygon,vertex3)

on a polygon. This gives me three vertices which I can then put into a general formula for triangle areas.

However, because these are Transformed verices, i.e. in World Space, the calculated area changes as a object is rotated. I need the absolute vertices of the underlying mesh, so I thought to apply

Matrix mtTransform =obj.getWorldTransformation().invert();

to "untransform" from World to Object vertices.

Does this rather clumsy method sound appropriate? Any comments welcome.

My method is to call (pseudo code)

polyManager.getTransformedVertex(polygon,vertex1)

polyManager.getTransformedVertex(polygon,vertex2)

polyManager.getTransformedVertex(polygon,vertex3)

on a polygon. This gives me three vertices which I can then put into a general formula for triangle areas.

However, because these are Transformed verices, i.e. in World Space, the calculated area changes as a object is rotated. I need the absolute vertices of the underlying mesh, so I thought to apply

Matrix mtTransform =obj.getWorldTransformation().invert();

to "untransform" from World to Object vertices.

Does this rather clumsy method sound appropriate? Any comments welcome.