Examples of Arrow


Examples of com.ardor3d.scenegraph.shape.Arrow

        _root.attachChild(_shapeRoot);
        _shapeRoot.getSceneHints().setDataMode(DataMode.Arrays);

        wrapCount = 5;
        addMesh(new Arrow("Arrow", 3, 1));
        addMesh(new AxisRods("AxisRods", true, 3, 0.5));
        addMesh(new Box("Box", new Vector3(), 3, 3, 3));
        addMesh(new Capsule("Capsule", 5, 5, 5, 2, 5));
        addMesh(new Cone("Cone", 8, 8, 2, 4));
        addMesh(new Cylinder("Cylinder", 8, 8, 2, 4));
View Full Code Here

Examples of com.ardor3d.scenegraph.shape.Arrow

                    .getY(), 0);
        }
    }

    private void buildRocket() {
        final Arrow rocket = new Arrow("rocket", 5, 2);
        rocket.setRotation(new Quaternion().fromAngleAxis(MathUtils.DEG_TO_RAD * -90, Vector3.UNIT_X));
        rocketEntityNode.attachChild(rocket);
        _root.attachChild(rocketEntityNode);
    }
View Full Code Here

Examples of com.ardor3d.scenegraph.shape.Arrow

    @Override
    protected void initExample() {
        _canvas.setTitle("Shapes Example");

        wrapCount = 5;
        addMesh(new Arrow("Arrow", 3, 1));
        addMesh(new AxisRods("AxisRods", true, 3, 0.5));
        addMesh(new Box("Box", new Vector3(), 3, 3, 3));
        addMesh(new Capsule("Capsule", 5, 5, 5, 2, 5));
        addMesh(new Cone("Cone", 8, 8, 2, 4));
        addMesh(new Cylinder("Cylinder", 8, 8, 2, 4));
View Full Code Here

Examples of com.dcaiti.eworld.visualizer.utilities.Arrow

        || super.getModelElement().getDestinationLongitude() == 0
        || Double.isNaN(super.getModelElement().getDestinationLatitude())
        || Double.isNaN(super.getModelElement().getDestinationLongitude()))
      return;

    Arrow destinationArrow = new Arrow();
    double distance = 1000 * Utilities.calculateDistance(
        GlobalPosition.from(Point2DUtils.convertPoint(super.getModelElement().getPosition())).getLatitude(),
        GlobalPosition.from(Point2DUtils.convertPoint(super.getModelElement().getPosition())).getLongitude(),
        super.getModelElement().getDestinationLatitude(), super.getModelElement().getDestinationLongitude());
    double angle = Utilities.calculateAngle(
        Point2DUtils.convertPoint(new double[] { super.getModelElement().getLatitude(),
            super.getModelElement().getLongitude() }),
        Point2DUtils.convertPoint(new double[] { super.getModelElement().getDestinationLatitude(),
            super.getModelElement().getDestinationLongitude() }));

    double destinationLatitude = Math.cos(Math.toRadians(angle - 90)) * distance;
    double destinationLongitude = Math.sin(Math.toRadians(angle - 90)) * distance;

    destinationArrow.setColor(Color.RED);
    destinationArrow.draw(painter, 0, 0, destinationLatitude, destinationLongitude);
  }
View Full Code Here

Examples of com.dcaiti.eworld.visualizer.utilities.Arrow

            .getDestinationLatitude())
        || Double.isNaN(super.getModelElement()
            .getDestinationLongitude()))
      return;

    Arrow destinationArrow = new Arrow();
    double distance = 1000 * Utilities.calculateDistance(
        GlobalPosition.from(
            Point2DUtils.convertPoint(super.getModelElement()
                .getPosition())).getLatitude(),
        GlobalPosition.from(
            Point2DUtils.convertPoint(super.getModelElement()
                .getPosition())).getLongitude(), super
            .getModelElement().getDestinationLatitude(), super
            .getModelElement().getDestinationLongitude());
    double angle = Utilities.calculateAngle(
        Point2DUtils.convertPoint(new double[] {
            super.getModelElement().getLatitude(),
            super.getModelElement().getLongitude() }),
        Point2DUtils.convertPoint(new double[] {
            super.getModelElement().getDestinationLatitude(),
            super.getModelElement().getDestinationLongitude() }));

    double destinationLatitude = Math.cos(Math.toRadians(angle - 90))
        * distance;
    double destinationLongitude = Math.sin(Math.toRadians(angle - 90))
        * distance;

    destinationArrow.setColor(Color.RED);
    destinationArrow.draw(painter, 0, 0, destinationLatitude,
        destinationLongitude);
  }
View Full Code Here

Examples of com.dcaiti.eworld.visualizer.utilities.Arrow

        || super.getModelElement().getDestinationLongitude() == 0
        || Double.isNaN(super.getModelElement().getDestinationLatitude())
        || Double.isNaN(super.getModelElement().getDestinationLongitude()))
      return;

    Arrow destinationArrow = new Arrow();
    double distance = 1000 * Utilities.calculateDistance(
        GlobalPosition.from(Point2DUtils.convertPoint(super.getModelElement().getPosition())).getLatitude(),
        GlobalPosition.from(Point2DUtils.convertPoint(super.getModelElement().getPosition())).getLongitude(),
        super.getModelElement().getDestinationLatitude(), super.getModelElement().getDestinationLongitude());
    double angle = Utilities.calculateAngle(
        Point2DUtils.convertPoint(new double[] { super.getModelElement().getLatitude(),
            super.getModelElement().getLongitude() }),
        Point2DUtils.convertPoint(new double[] { super.getModelElement().getDestinationLatitude(),
            super.getModelElement().getDestinationLongitude() }));

    double destinationLatitude = Math.cos(Math.toRadians(angle - 90)) * distance;
    double destinationLongitude = Math.sin(Math.toRadians(angle - 90)) * distance;

    destinationArrow.setColor(Color.RED);
    destinationArrow.draw(painter, 0, 0, destinationLatitude, destinationLongitude);
  }
View Full Code Here

Examples of com.jme.scene.shape.Arrow

       
        Vector3f direction = directionalLight.getDirection();
        Vector3f position = lightNode.getLocalTranslation();
        Vector3f labelPosition = new Vector3f(position.x, position.y + 3, position.z);
       
        Arrow arrow = new Arrow("Arrow", 3, 0.5f);
        Node rotatedOnX = new Node("Rotated For Arrow");
        rotatedOnX.setLocalRotation(new Quaternion().fromAngleAxis(90*FastMath.DEG_TO_RAD, new Vector3f(1, 0, 0)));
        rotatedOnX.attachChild(arrow);
        rotatedOnX.setLocalTranslation(position);
//        arrow.setLocalTranslation(position);
        label.setLocalTranslation(labelPosition);
        arrow.lookAt(direction, new Vector3f(0,1,0));
        rootNode.attachChild(label);
        rootNode.attachChild(rotatedOnX);
        // Fetch the world translation for the root node of the cell and set
        // the translation for this entity root node
        rootNode.setLocalTranslation(transform.getTranslation(null));
View Full Code Here

Examples of com.jme.scene.shape.Arrow

     */
    private Node createArrow(String name, float length, float width, ColorRGBA color) {

        // Create the two arrows with the proper name, length, thickness, and
        // color.
        Arrow a1 = new Arrow(name + " 1", length, width);
        a1.setSolidColor(color);
        Arrow a2 = new Arrow(name + " 2", length, width);
        a2.setSolidColor(color);

        // Create the main node and set the material state on the node so the
        // color shows up
        Node n = new Node();
        RenderManager rm = ClientContextJME.getWorldManager().getRenderManager();
        MaterialState matState3 = (MaterialState)rm.createRendererState(StateType.Material);
        matState3.setDiffuse(color);
        n.setRenderState(matState3);

        // Create a sub-node to hold the first arrow. We must translate it up,
        // so that the end is at (0, 0, 0) in the local coordinate space of
        // the node we return
        Node subNode1 = new Node();
        subNode1.setLocalTranslation(0, length / 2, 0);
        subNode1.attachChild(a1);

        // Create a sub-node to hold the second arrow. We must rotate it 180
        // degrees (about the +y axis since arrows by default point up). We
        // also must translate it down. Attach the second arrow to this node.
        Node subNode2 = new Node();
        Quaternion q = new Quaternion().fromAngleAxis((float)Math.PI, new Vector3f(0, 0, 1));
        subNode2.setLocalRotation(q);
        subNode2.setLocalTranslation(0, -length / 2, 0);
        subNode2.attachChild(a2);

        // Attach the first arrow and the subnode to the main node
        n.attachChild(subNode1);
        n.attachChild(subNode2);

        // Set the bounds on the arrows and update them
        a1.setModelBound(new BoundingSphere());
        a1.updateModelBound();
        a2.setModelBound(new BoundingSphere());
        a2.updateModelBound();

        return n;
    }
View Full Code Here

Examples of com.jme.scene.shape.Arrow

    public void RefreshDrivesMeshes(DynamicPhysicsNode rootNode)
    {
        int i=0;
        for (MoveDrive md : drives)
        {
            Arrow a=new Arrow("d"+i,3f,0.2f);
            a.setLocalTranslation(md.getPosition());


            //? Mesh orientation in ortogonal vector not clear
            Vector3f v=md.getDirection();
            if (v.x==0) v.x=0.0001f;

            a.rotateUpTo(v);
            a.updateModelBound();
            i++;
            rootNode.attachChild(a);
            driveMeshes.add(a);
        }
    }
View Full Code Here

Examples of com.jme.scene.shape.Arrow

        materialx.setDiffuse( color );
        materialx.setAmbient( color.mult( new ColorRGBA( 1f, 0.1f, 0.1f, 1 ) ) );



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

        MaterialState materialy = display.getRenderer().createMaterialState();
        materialy.setShininess( 128 );
        color = new ColorRGBA( 0f, 1f, 0f, 0.5f );
        materialy.setDiffuse( color );
        materialy.setAmbient( color.mult( new ColorRGBA( 0.1f, 1f, 0.1f, 0.5f ) ) );

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

        MaterialState materialz = display.getRenderer().createMaterialState();
        materialz.setShininess( 128 );
        color = new ColorRGBA( 0f, 0f, 1f, 0.5f );
        materialz.setDiffuse( color );
        materialz.setAmbient( color.mult( new ColorRGBA( 0.1f, 0.1f, 1f, 0.5f ) ) );

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

        camPosBall=new Sphere("cameraPosition",new Vector3f(0,0,0),10,10,0.02f);
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.