I have several cubes, those cubes have the 8 vertices, for example:
Vet X Y Z
----- CUBE1 -----
(top side)
V1: -0.5 0.5 0.5
V2: 0.5 0.5 0.5
V3: 0.5 0.5 -0.5
V4: -0.5 0.5 -0.5
(bottom side)
V5: -0.5 -0.5 0.5
V6: 0.5 -0.5 0.5
V7: 0.5 -0.5 -0.5
V8: -0.5 -0.5 -0.5
----- CUBE2 -----
(top side)
V1: 0.5 0.5 0.5
V2: 1.5 0.5 0.5
V3: 1.5 0.5 -0.5
V4: 0.5 0.5 -0.5
(bottom side)
V5: 0.5 -0.5 0.5
V6: 1.5 -0.5 0.5
V7: 1.5 -0.5 -0.5
V8: 0.5 -0.5 -0.5
How do I find the point X, Y and Z in the center of this cube?
P.s.: the solution must be independent of the cube coordinates being positive or negative.
In this case the center of the cube1 would be (0, 0, 0) and cube2 would be (1, 0, 0)
I hope a help!