### Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

### Topics - Alexei_B

Pages: 
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.

2
##### Support / Calculate Volume?
« on: December 12, 2007, 03:08:57 pm »
I suspect this simple question may be difficult to answer, but how do I calculate the volume of a closed 3-d shape?   Obviously simple geometric primitives like cubes, rectangles, spheres, cones etc. all have known formulae.

Even shapes bounded by known equations describing planes can have volumes found via 3d integration methods.

But what if I need the volume of a more complex mesh/object representing a simple house for example?

My only thought is that 2d areas can be calculated by iterative methods - literally filling a space with tiny units and counting them - something like how the fill or paint bucket tools work in drawing programmes.  Perhaps this could be extended to a 3d solution?