Package org.gephi.lib.gleem.linalg

Examples of org.gephi.lib.gleem.linalg.Vec3f.normalize()


        //Transform in 3d coordinates
        mouseX /= -graphDrawable.draggingMarker[0];
        mouseY /= -graphDrawable.draggingMarker[1];

        //Set stepVector for zooming, direction of camera and norm of step
        cameraVector.normalize();
        Vec3f stepVec = cameraVector.times(step);

        cameraLocation[0] += stepVec.x();
        cameraLocation[1] += stepVec.y();
        cameraLocation[2] += stepVec.z();
View Full Code Here


        float cameraTarget[] = graphDrawable.getCameraTarget();
        Vec3f camVect = new Vec3f(cameraTarget[0] - cameraLocation[0], cameraTarget[1] - cameraLocation[1], cameraTarget[2] - cameraLocation[2]);

        float diff = camVect.length() - distance;
        if (Math.abs(diff) > 1f) {
            camVect.normalize();
            cameraLocation[0] += camVect.x() * diff;
            cameraLocation[1] += camVect.y() * diff;
            cameraLocation[2] += camVect.z() * diff;
            cameraLocation[2] = Math.max(0.5f, cameraLocation[2]);

View Full Code Here

        float y = node.y();
        float z = node.z();

        //CameraVector, from camera location to any point on the line
        Vec3f cameraVector = new Vec3f(x - cameraLocation[0], y - cameraLocation[1], z - cameraLocation[2]);
        cameraVector.normalize();

        //Get two vectors perpendicular to cameraVector
        Vec3f upVector = transVector.cross(cameraVector);
        upVector.normalize();
        Vec3f sideVector = cameraVector.cross(upVector);
View Full Code Here

        Vec3f cameraVector = new Vec3f(x - cameraLocation[0], y - cameraLocation[1], z - cameraLocation[2]);
        cameraVector.normalize();

        //Get two vectors perpendicular to cameraVector
        Vec3f upVector = transVector.cross(cameraVector);
        upVector.normalize();
        Vec3f sideVector = cameraVector.cross(upVector);
        sideVector.normalize();

        //Get thickness points
        float baseRightX = x + sideVector.x() * w / 2;
View Full Code Here

        //Get two vectors perpendicular to cameraVector
        Vec3f upVector = transVector.cross(cameraVector);
        upVector.normalize();
        Vec3f sideVector = cameraVector.cross(upVector);
        sideVector.normalize();

        //Get thickness points
        float baseRightX = x + sideVector.x() * w / 2;
        float baseRightY = y + sideVector.y() * w / 2;
        float baseRightZ = z + sideVector.z() * w / 2;
View Full Code Here

        float arrowWidth = ARROW_WIDTH * w * 2f;
        float arrowHeight = ARROW_HEIGHT * w * 2f;

        //Edge vector
        Vec3f edgeVector = new Vec3f(nodeTo.x() - nodeFrom.x(), nodeTo.y() - nodeFrom.y(), nodeTo.z() - nodeFrom.z());
        edgeVector.normalize();

        //Get collision distance between nodeTo and arrow point
        double angle = Math.atan2(nodeTo.y() - nodeFrom.y(), nodeTo.x() - nodeFrom.x());

        if (nodeTo.getModel() == null) {
View Full Code Here

        //Camera vector
        Vec3f cameraVector = new Vec3f(targetX - cameraLocation[0], targetY - cameraLocation[1], targetZ - cameraLocation[2]);

        //Side vector
        Vec3f sideVector = edgeVector.cross(cameraVector);
        sideVector.normalize();

        //Draw the triangle
        if (!selected) {
            float r;
            float g;
View Full Code Here

        //Camera vector
        Vec3f cameraVector = new Vec3f(targetX - cameraLocation[0], targetY - cameraLocation[1], targetZ - cameraLocation[2]);

        //Side vector
        Vec3f sideVector = edgeVector.cross(cameraVector);
        sideVector.normalize();

        //Draw the triangle
        if (!selected) {
            float r;
            float g;
View Full Code Here

        float cameraTarget[] = graphDrawable.getCameraTarget();
        Vec3f camVect = new Vec3f(cameraTarget[0] - cameraLocation[0], cameraTarget[1] - cameraLocation[1], cameraTarget[2] - cameraLocation[2]);

        float diff = camVect.length() - distance;
        if (Math.abs(diff) > 1f) {
            camVect.normalize();
            cameraLocation[0] += camVect.x() * diff;
            cameraLocation[1] += camVect.y() * diff;
            cameraLocation[2] += camVect.z() * diff;
            cameraLocation[2] = Math.max(0.5f, cameraLocation[2]);

View Full Code Here

        float y = node.y();
        float z = node.z();

        //CameraVector, from camera location to any point on the line
        Vec3f cameraVector = new Vec3f(x - cameraLocation[0], y - cameraLocation[1], z - cameraLocation[2]);
        cameraVector.normalize();

        //Get two vectors perpendicular to cameraVector
        Vec3f upVector = transVector.cross(cameraVector);
        upVector.normalize();
        Vec3f sideVector = cameraVector.cross(upVector);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.