Examples of Arrow


Examples of com.jme.scene.shape.Arrow

        axisRoot=new Node("axnode");
        axisRoot.setLocalTranslation(0, 0, 0);
        planeXY=new Box("planeXY",new Vector3f(0.05f,0,0.05f),0.1f,0.0001f,0.1f);

        axisXArrow=new Arrow("ax",0.1f,0.01f);
        axisXArrow.setLocalTranslation(new Vector3f(0.05f,0,0));
        axisXArrow.rotateUpTo(new Vector3f(1,0,0));
       
       

        axisYArrow=new Arrow("ay",0.1f,0.01f);
        axisYArrow.setLocalTranslation(new Vector3f(0,0.05f,0));
        axisYArrow.rotateUpTo(new Vector3f(0,1,0));

        axisZArrow=new Arrow("az",0.1f,0.01f);
        axisZArrow.setLocalTranslation(new Vector3f(0,0,0.05f));
        axisZArrow.rotateUpTo(new Vector3f(0,0,1));

        axisRoot.attachChild(axisXArrow);
        axisRoot.attachChild(axisYArrow);
View Full Code Here

Examples of com.jme3.scene.debug.Arrow

    public BulletJointDebugControl(BulletDebugAppState debugAppState, PhysicsJoint body) {
        super(debugAppState);
        this.body = body;
        this.geomA = new Geometry(body.toString());
        arrowA = new Arrow(Vector3f.ZERO);
        geomA.setMesh(arrowA);
        geomA.setMaterial(debugAppState.DEBUG_GREEN);
        this.geomB = new Geometry(body.toString());
        arrowB = new Arrow(Vector3f.ZERO);
        geomB.setMesh(arrowB);
        geomB.setMaterial(debugAppState.DEBUG_GREEN);
    }
View Full Code Here

Examples of com.jme3.scene.debug.Arrow

            Vector3f direction = physicsVehicleWheel.getDirection().clone();
            Vector3f axle = physicsVehicleWheel.getAxle().clone();
            float restLength = physicsVehicleWheel.getRestLength();
            float radius = physicsVehicleWheel.getRadius();

            Arrow locArrow = new Arrow(location);
            Arrow axleArrow = new Arrow(axle.normalizeLocal().multLocal(0.3f));
            Arrow wheelArrow = new Arrow(direction.normalizeLocal().multLocal(radius));
            Arrow dirArrow = new Arrow(direction.normalizeLocal().multLocal(restLength));
            Geometry locGeom = new Geometry("WheelLocationDebugShape" + i, locArrow);
            Geometry dirGeom = new Geometry("WheelDirectionDebugShape" + i, dirArrow);
            Geometry axleGeom = new Geometry("WheelAxleDebugShape" + i, axleArrow);
            Geometry wheelGeom = new Geometry("WheelRadiusDebugShape" + i, wheelArrow);
            dirGeom.setLocalTranslation(location);
View Full Code Here

Examples of com.jme3.scene.debug.Arrow

            Geometry locGeom = (Geometry) suspensionNode.getChild("WheelLocationDebugShape" + i);
            Geometry dirGeom = (Geometry) suspensionNode.getChild("WheelDirectionDebugShape" + i);
            Geometry axleGeom = (Geometry) suspensionNode.getChild("WheelAxleDebugShape" + i);
            Geometry wheelGeom = (Geometry) suspensionNode.getChild("WheelRadiusDebugShape" + i);

            Arrow locArrow = (Arrow) locGeom.getMesh();
            locArrow.setArrowExtent(location);
            Arrow axleArrow = (Arrow) axleGeom.getMesh();
            axleArrow.setArrowExtent(axle.normalizeLocal().multLocal(0.3f));
            Arrow wheelArrow = (Arrow) wheelGeom.getMesh();
            wheelArrow.setArrowExtent(direction.normalizeLocal().multLocal(radius));
            Arrow dirArrow = (Arrow) dirGeom.getMesh();
            dirArrow.setArrowExtent(direction.normalizeLocal().multLocal(restLength));

            dirGeom.setLocalTranslation(location);
            axleGeom.setLocalTranslation(location.addLocal(direction));
            wheelGeom.setLocalTranslation(location);
            i++;
View Full Code Here

Examples of com.jme3.scene.debug.Arrow

  public static void main(String[] args) {
    new BaseGame().start();
  }

  private void attachCoordinateAxes(Vector3f pos) {
    Arrow arrow = new Arrow(Vector3f.UNIT_X);
    arrow.setLineWidth(4); // make arrow thicker
    putShape(arrow, ColorRGBA.Red).setLocalTranslation(pos);

    arrow = new Arrow(Vector3f.UNIT_Y);
    arrow.setLineWidth(4); // make arrow thicker
    putShape(arrow, ColorRGBA.Green).setLocalTranslation(pos);

    arrow = new Arrow(Vector3f.UNIT_Z);
    arrow.setLineWidth(4); // make arrow thicker
    putShape(arrow, ColorRGBA.Blue).setLocalTranslation(pos);
  }
View Full Code Here

Examples of com.jme3.scene.debug.Arrow

        ScenegraphNode coordNode = new ScenegraphNode("Coodination Grid");
        ScenegraphNode labelNode = new ScenegraphNode("Grid labels");
        coordNode.attachChild(labelNode);

        // create x-axis
        Arrow arrowX = new Arrow(new Vector3f(size, 0.0f, 0.0f));
        xAxis = new Geometry("X-Axis", arrowX);
        mat = new Material(am, Materials.UNSHADED);
        mat.setColor("Color", ColorRGBA.Red);
        xAxis.setMaterial(mat);

        // create xy-grid
        Grid xyPlane = new Grid(size, size, segSize);
        xyGrid = new Geometry("XY-Plane", xyPlane);
        xyGrid.setMaterial(mat);
        xyGrid.rotateUpTo(new Vector3f(0.0f, 0.0f, 1.0f));
        xyGrid.setLocalTranslation(new Vector3f(-offset, offset, 0.0f));

        // create y-axis
        Arrow arrowY = new Arrow(new Vector3f(0.0f, size, 0.0f));
        yAxis = new Geometry("Y-Axis", arrowY);
        mat = new Material(am, Materials.UNSHADED);
        mat.setColor("Color", ColorRGBA.Green);
        yAxis.setMaterial(mat);

        // create yz-grid
        Grid yzPlane = new Grid(size, size, segSize);
        yzGrid = new Geometry("YZ-Plane", yzPlane);
        yzGrid.setMaterial(mat);
        yzGrid.rotateUpTo(new Vector3f(1.0f, 0.0f, 0.0f));
        yzGrid.setLocalTranslation(new Vector3f(0.0f, offset, -offset));

        // create z-axis
        Arrow arrowZ = new Arrow(new Vector3f(0.0f, 0.0f, size));
        zAxis = new Geometry("Z-Axis", arrowZ);
        mat = new Material(am, Materials.UNSHADED);
        mat.setColor("Color", ColorRGBA.Blue);
        zAxis.setMaterial(mat);
View Full Code Here

Examples of com.jme3.scene.debug.Arrow

                                           Material mat) {
        if (vertices != null) {
            int n = vertices.length;
            if (n > 2) {
                Node node = new Node("Polygon-" + n);
                Arrow arrow;
                Geometry g;

                for (int i = 0; i < n; i++) {
                    v3f_0.set(vertices[i]);

                    if ((i + 1) < n)
                        v3f_1.set(vertices[i + 1]);
                    else v3f_1.set(vertices[0]);

                    arrow = new Arrow(v3f_1.subtract(v3f_0));
                    g = new Geometry("", arrow);
                    g.setLocalTranslation(v3f_0);
                    g.setMaterial(mat);
                    node.attachChild(g);
                }
View Full Code Here

Examples of com.jme3.scene.debug.Arrow

        }
    }

    public static ScenegraphNode buildNormals(Geometry refGeom) {
        Geometry g;
        Arrow a;
        ScenegraphNode normals = new ScenegraphNode("Normals");
        Vector3f dir = new Vector3f();

        FloatBuffer nB = refGeom.getMesh().getFloatBuffer(Type.Normal);
        FloatBuffer vB = refGeom.getMesh().getFloatBuffer(Type.Position);

        for (int i = 0; i < nB.limit(); i += 3) {
            dir.set(nB.get(i), nB.get(i + 1), nB.get(i + 2));
            a = new Arrow(dir);
            a.setLineWidth(3f);
            g = new Geometry("Normal" + dir, a);
            g.scale(.1f);
            g.setLocalTranslation(vB.get(i), vB.get(i + 1), vB.get(i + 2));
            g.setMaterial(DebugMaterials.normalMat);
            normals.attachChild(g);
View Full Code Here

Examples of com.jme3.scene.debug.Arrow

        return normals;
    }

    public static ScenegraphNode buildTangents(Geometry refGeom) {
        Geometry g;
        Arrow a;
        ScenegraphNode tangents = new ScenegraphNode("Tangents");
        Vector3f dir = new Vector3f();

        FloatBuffer tB = refGeom.getMesh().getFloatBuffer(Type.Tangent);
        FloatBuffer vB = refGeom.getMesh().getFloatBuffer(Type.Position);

        int posFix = 0;
        for (int i = 0; i < tB.limit(); i += 4) {
            dir.set(tB.get(i), tB.get(i + 1), tB.get(i + 2)).normalizeLocal();
            a = new Arrow(dir);
            a.setLineWidth(2f);
            g = new Geometry("Tangent" + dir, a);
            g.scale(.1f);
            g.setLocalTranslation(vB.get(i - posFix), vB.get((i - posFix) + 1),
                                  vB.get((i - posFix) + 2));
            g.setMaterial(DebugMaterials.tangentMat);
View Full Code Here

Examples of com.jme3.scene.debug.Arrow

        return tangents;
    }

    public static ScenegraphNode buildBinormals(Geometry refGeom) {
        Geometry g;
        Arrow a;
        ScenegraphNode binormals = new ScenegraphNode("Binormals");
        Vector3f dir = new Vector3f();

        FloatBuffer bnB = refGeom.getMesh().getFloatBuffer(Type.Binormal);
        FloatBuffer vB = refGeom.getMesh().getFloatBuffer(Type.Position);

        for (int i = 0; i < bnB.limit(); i += 3) {
            dir.set(bnB.get(i), bnB.get(i + 1), bnB.get(i + 2));
            a = new Arrow(dir);
            g = new Geometry("Binormal" + dir, a);
            g.scale(.1f);
            g.setLocalTranslation(vB.get(i), vB.get(i + 1), vB.get(i + 2));
            g.setMaterial(DebugMaterials.binormalMat);
            binormals.attachChild(g);
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.