Search in sources :

Example 6 with Matrix33f

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]);
    });
}
Also used : Matrix44f(au.gov.asd.tac.constellation.utilities.graphics.Matrix44f) Matrix33f(au.gov.asd.tac.constellation.utilities.graphics.Matrix33f) Vector3f(au.gov.asd.tac.constellation.utilities.graphics.Vector3f)

Aggregations

Matrix33f (au.gov.asd.tac.constellation.utilities.graphics.Matrix33f)6 Matrix44f (au.gov.asd.tac.constellation.utilities.graphics.Matrix44f)6 Vector3f (au.gov.asd.tac.constellation.utilities.graphics.Vector3f)6 Frame (au.gov.asd.tac.constellation.utilities.graphics.Frame)5 BitSet (java.util.BitSet)4 SetBooleanValuesOperation (au.gov.asd.tac.constellation.graph.operations.SetBooleanValuesOperation)2 Camera (au.gov.asd.tac.constellation.utilities.camera.Camera)2 ArrayList (java.util.ArrayList)1