use of au.gov.asd.tac.constellation.utilities.graphics.Matrix33f in project constellation by constellation-app.
the class VisualGraphUtilities method streamVertexSceneLocations.
public static Stream<Vector3f> streamVertexSceneLocations(GraphReadMethods rg, final Camera camera) {
// Get a copy of the current rotation matrix.
final Matrix44f modelViewMatrix = Graphics3DUtilities.getModelViewMatrix(camera);
final Matrix33f rotationMatrix = new Matrix33f();
modelViewMatrix.getRotationMatrix(rotationMatrix);
// Convert from world to scene coordinates
Stream<Vector3f> worldLocations = streamVertexWorldLocations(rg, camera);
return worldLocations.map(worldLocation -> {
final float[] screenLocation = modelViewMatrix.multiply(worldLocation.getX(), worldLocation.getY(), worldLocation.getZ(), 1);
return new Vector3f(screenLocation[0], screenLocation[1], screenLocation[2]);
});
}
Aggregations