Vertices in Worldspace

Started by AGP, January 09, 2014, 10:06:55 PM

Previous topic - Next topic

AGP

Does the following method make sense? If not, how would I go about getting all vertices in worldspace?


     private SimpleVector wsVertices(Object3D obj) {
GenericVertexController vertexController = new GenericVertexController();
vertexController.init(obj.getMesh());
SimpleVector[] vertices = vertexController.getSourceMesh();
for (int i = 0; i < vertices.length; i++)
     vertices[i] *= obj.getTranslation(); //OR MAYBE obj.getTransformedCenter()?
return vertices;
     }

EgonOlsen

Replace


vertices[i] *= obj.getTranslation();


with


vertices[i] *= obj.getWorldTransformation();


and it should work.

AGP