Package com.ardor3d.scenegraph.shape

Examples of com.ardor3d.scenegraph.shape.Sphere


        n1.setTranslation(new Vector3(0, 0, -200));
        _root.attachChild(n1);

        final Random rand = new Random(1337);

        final Sphere sphere = new Sphere("Sphere", 8, 8, 1);
        sphere.updateModelBound();

        for (int i = 0; i < 200; i++) {
            final Mesh sm = sphere.makeCopy(true);

            sm.setTranslation(new Vector3(rand.nextDouble() * 100.0 - 50.0, rand.nextDouble() * 100.0 - 50.0, rand
                    .nextDouble() * 100.0 - 50.0));
            sm.setRenderState(ts);
            n1.attachChild(sm);
        }

        n2 = new Node("n2");
        n2.setTranslation(new Vector3(0, 0, -200));

        final MaterialState ms = new MaterialState();
        ms.setDiffuse(MaterialFace.FrontAndBack, ColorRGBA.RED);
        n2.setRenderState(ms);

        _root.attachChild(n2);

        for (int i = 0; i < 200; i++) {
            final Mesh sm = sphere.makeCopy(true);

            sm.setTranslation(new Vector3(rand.nextDouble() * 100.0 - 50.0, rand.nextDouble() * 100.0 - 50.0, rand
                    .nextDouble() * 100.0 - 50.0));
            sm.setRenderState(ts);
            n2.attachChild(sm);
View Full Code Here


        _root.attachChild(box);
        ts = new TextureState();
        ts.setTexture(TextureManager.load("images/ardor3d_white_256.jpg", Texture.MinificationFilter.Trilinear, true));
        box.setRenderState(ts);

        sphere = new Sphere("Sphere", 16, 16, 4);
        _root.attachChild(sphere);

        // Setup labels for presenting example info.
        final Node textNodes = new Node("Text");
        _root.attachChild(textNodes);
View Full Code Here

    @Override
    protected void initExample() {
        _canvas.setTitle("RTT Side By Side");

        sphere = new Sphere("Sphere", 25, 25, 5);
        sphere.setTranslation(new Vector3(-10, 0, 0));
        sphere.setModelBound(new BoundingBox());
        _root.attachChild(sphere);

        quad = new Quad("Quad", 15, 13f);
View Full Code Here

    @Override
    protected void initExample() {
        _canvas.setTitle("Particle System - Swarming Influence");
        _lightState.setEnabled(false);

        sphere = new Sphere("sp", 12, 12, 3);
        sphere.setModelBound(new BoundingBox());
        sphere.setDefaultColor(ColorRGBA.BLUE);
        sphere.getSceneHints().setRenderBucketType(RenderBucketType.Opaque);

        particles = ParticleFactory.buildParticles("particles", 30);
View Full Code Here

        CollisionTreeManager.getInstance().setTreeType(CollisionTree.Type.AABB);
        CollisionTreeManager.getInstance().setDoSort(true);

        results = new PrimitiveCollisionResults();
        sphere = new Sphere("sphere", 10, 10, 2);

        sphere.setSolidColor(ColorRGBA.WHITE);
        sphere.setModelBound(new BoundingBox());

        sphereNode = new Node("sphere node");
View Full Code Here

        final Box box = new Box("Box", new Vector3(), 1, 1, 4);
        box.setModelBound(new BoundingBox());
        box.setRandomColors();

        targetMesh = new Sphere("Target", 8, 8, 2);
        // update the default bounding sphere
        targetMesh.updateModelBound();
        _root.attachChild(targetMesh);
        targetMesh.setRandomColors();
View Full Code Here

    @Override
    protected void initExample() {
        _canvas.setTitle("RTT Side By Side");

        sphere = new Sphere("Sphere", 25, 25, 5);
        sphere.setTranslation(new Vector3(-10, 0, 0));
        sphere.setModelBound(new BoundingBox());
        _root.attachChild(sphere);

        quad = new Quad("Quad", 15, 13f);
View Full Code Here

        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));
        sphere.setRenderState(ts);
        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();
        ts.setTexture(TextureManager.load("images/skybox/3.jpg", Texture.MinificationFilter.Trilinear, true));
        box2.setRenderState(ts);
        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);
View Full Code Here

        final Node sphereBase = new Node("node");
        _root.attachChild(sphereBase);

        final Random rand = new Random(1337);
        for (int i = 0; i < 100; i++) {
            final Sphere sphere = new Sphere("Sphere", 32, 32, 2);
            sphere.setRandomColors();
            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);
        }

View Full Code Here

                TextureStoreFormat.GuessCompressedFormat, true));
        _root.setRenderState(ts);

        final Node globesNode = new Node("globes");

        Sphere sphere = new Sphere("Linear mapping", Vector3.ZERO, 65, 65, 1, TextureMode.Linear);
        globesNode.attachChild(sphere);

        sphere = new Sphere("With mapping", 65, 65, 1);
        sphere = new Sphere("Projected mapping", Vector3.ZERO, 65, 65, 1, TextureMode.Projected);
        globesNode.attachChild(sphere);

        GeoSphere geoSphere = new GeoSphere("UV geo sphere - original", true, 2.0, 3, GeoSphere.TextureMode.Original);
        globesNode.attachChild(geoSphere);

        geoSphere = new GeoSphere("UV geo sphere - projected", true, 2.0, 3, GeoSphere.TextureMode.Projected);
        globesNode.attachChild(geoSphere);

        sphere = new Sphere("Projected mapping, radius 2", Vector3.ZERO, 65, 65, 2, TextureMode.Projected);
        globesNode.attachChild(sphere);

        globesNode.setRotation(new Quaternion().fromAngleAxis(-MathUtils.HALF_PI, Vector3.UNIT_X));
        int startX = -globesNode.getChildren().size() / 2;
        for (final Spatial s : globesNode.getChildren()) {
View Full Code Here

TOP

Related Classes of com.ardor3d.scenegraph.shape.Sphere

Copyright © 2018 www.massapicom. 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.