I have objects in 3D which have 8 corners and most of the time they look like cubes. I need to compute the volume of those objects. Since they are not axis-aligned I can't use the standard formula $V = l^3$.
Are there other solutions?
On
Not sure if I understand exactly what you mean, but it seems you can calculate the lengths of the sides of the cube by applying the formula for norm of vectors, i.e. length equals $\sqrt{(x_1-x_o)^2 + (y_1-y_2)^2 + (z_1 - z_2)^2}$ and then applying the formula for a cube.
On
If the body is a Parallelepiped, generated by the vectors $\vec a, \vec b, \vec c$, the volume is the absolute value of the triple product $$(\vec a\times\vec b)\cdot\vec c$$ (that also can be calculated as the determinant of the matrix formed by the column vectors $\vec a, \vec b, \vec c$).
Divide your cuboid into tetrahedra, compute the volume of each tetrahedron and add them.
The volume of a tetrahedron with vertices $OPQR$ is given by: $$ V={1\over6}|(P-O)\cdot(Q-O)\times(R-O)|. $$
A possible decomposition is shown below: a cuboid with opposite faces $ABCD$ and $EFGH$ is the sum of five tetrahedra $ABCF$, $ACDH$, $AFEH$, $CFGH$, $ACFH$.