Package com.ardor3d.scenegraph

Examples of com.ardor3d.scenegraph.Node.attachChild()


        box1.getSceneHints().setPickingHint(PickingHint.Pickable, true);
        box1.setModelBound(new BoundingBox());

        final Node base = new Node();
        base.setTranslation(0, 0, 0);
        base.attachChild(box1);
        _root.attachChild(base);

        final Sphere sphere = new Sphere("sphere", Vector3.ZERO, 16, 16, 8);
        ts = new TextureState();
        ts.setTexture(TextureManager.load("images/water/dudvmap.png", Texture.MinificationFilter.Trilinear, true));
View Full Code Here


        sphere.getSceneHints().setPickingHint(PickingHint.Pickable, true);
        sphere.setModelBound(new BoundingSphere());

        final Node joint = new Node();
        joint.setTranslation(0, sphere.getRadius() + 2 * box1.getYExtent(), 0);
        joint.attachChild(sphere);
        base.attachChild(joint);

        final Box box2 = new Box("box", Vector3.ZERO, 5, 15, 5);
        box2.setTranslation(0, box2.getYExtent(), 0);
        ts = new TextureState();
View Full Code Here

        box2.getSceneHints().setPickingHint(PickingHint.Pickable, true);
        box2.setModelBound(new BoundingBox());

        final Node arm = new Node();
        arm.setTranslation(0, sphere.getRadius(), 0);
        arm.attachChild(box2);
        joint.attachChild(arm);

        // auto select the joint
        _root.updateGeometricState(0);
        manager.setSpatialTarget(joint);
View Full Code Here

        final double infoStartY = _canvas.getCanvasRenderer().getCamera().getHeight();
        for (int i = 0; i < _exampleInfo.length; i++) {
            _exampleInfo[i] = BasicText.createDefaultTextLabel("Text", "", 16);
            _exampleInfo[i].setTranslation(new Vector3(10, infoStartY - (i + 1) * 20, 0));
            textNodes.attachChild(_exampleInfo[i]);
        }

        textNodes.updateGeometricState(0.0);
        updateText();

View Full Code Here

            b.setModelBound(new BoundingBox());
            final double x = Math.random() * 1000 - 500;
            final double z = Math.random() * 1000 - 500;
            b.setTranslation(new Vector3(x, y, z));

            occluders.attachChild(b);
        }

        final Torus torusWithoutShadows = new Torus("torus", 32, 10, 15.0f, 20.0f);
        torusWithoutShadows.setModelBound(new BoundingBox());
        torusWithoutShadows.getSceneHints().setCastsShadows(false);
View Full Code Here

            sphere.setModelBound(new BoundingBox());
            sphere.setRenderState(ts);
            sphere.setTranslation(new Vector3(rand.nextDouble() * 100.0 - 50.0, rand.nextDouble() * 100.0 - 50.0, rand
                    .nextDouble() * 100.0 - 250.0));

            sphereBase.attachChild(sphere);
        }

        _logicalLayer.registerTrigger(new InputTrigger(new KeyPressedCondition(Key.SPACE), new TriggerAction() {
            public void perform(final Canvas source, final TwoInputStates inputStates, final double tpf) {
                vboMode = (vboMode + 1) % 3;
View Full Code Here

        final Torus torusWithoutShadows = new Torus("torus", 32, 10, 15.0f, 20.0f);
        torusWithoutShadows.setModelBound(new BoundingBox());
        torusWithoutShadows.getSceneHints().setCastsShadows(false);
        torusWithoutShadows.setTranslation(0, 50, -100);
        occluders.attachChild(torusWithoutShadows);

        final Torus torus = new Torus("torus", 64, 12, 10.0f, 15.0f);
        torus.setModelBound(new BoundingBox());
        occluders.attachChild(torus);
        torus.addController(new SpatialController<Torus>() {
View Full Code Here

        torusWithoutShadows.setTranslation(0, 50, -100);
        occluders.attachChild(torusWithoutShadows);

        final Torus torus = new Torus("torus", 64, 12, 10.0f, 15.0f);
        torus.setModelBound(new BoundingBox());
        occluders.attachChild(torus);
        torus.addController(new SpatialController<Torus>() {
            double timer = 0;
            Matrix3 rotation = new Matrix3();

            public void update(final double time, final Torus caller) {
View Full Code Here

                caller.setRotation(rotation);
            }
        });

        // Attach "billboard" with an alpha test.
        occluders.attachChild(makeBillBoard());

        return occluders;
    }

    private Spatial makeBillBoard() {
View Full Code Here

        q1.setTranslation(0, 80, 0);
        q1.setModelBound(new BoundingBox());
        final CullState cs = new CullState();
        cs.setCullFace(CullState.Face.None);
        q1.setRenderState(cs);
        billboard.attachChild(q1);

        final TextureState ts = new TextureState();
        ts.setEnabled(true);
        ts.setTexture(TextureManager.load("fonts/OkasaSansSerif-35-medium-regular_00.png",
                Texture.MinificationFilter.Trilinear, true));
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.