Package com.ardor3d.scenegraph

Examples of com.ardor3d.scenegraph.Point


        public Line line;

        public LineEntry(final int maxSamples, final StatType type) {
            this.maxSamples = maxSamples;

            point = new Point("p", BufferUtils.createVector3Buffer(maxSamples), null, null, null);
            point.getSceneHints().setRenderBucketType(RenderBucketType.Ortho);

            point.setDefaultColor(getColorConfig(type, ConfigKeys.PointColor.name(), new ColorRGBA(ColorRGBA.WHITE)));
            point.setPointSize(getIntConfig(type, ConfigKeys.PointSize.name(), 5));
            point.setAntialiased(getBooleanConfig(type, ConfigKeys.Antialias.name(), true));
View Full Code Here


     * @return A <code>Point</code> containing all the curve points, will not be <code>null</code>.
     */
    public Point toRenderablePoint(final int start, final int end, final int steps) {
        final Vector3[] points = toVector3(start, end, steps);

        return new Point("point", points, null, null, null);
    }
View Full Code Here

            int i = 0;
            for (final ObjIndexSet set : _pointManager.getStore().keySet()) {
                vertices[i++] = _dataStore.getVertices().get(set.getVIndex());
            }

            final Point points = new Point(name, vertices, null, null, null);
            final IndexBufferData<? extends Buffer> indexBuffer = BufferUtils.createIndexBufferData(_pointManager
                    .getIndices().size(), vertices.length - 1);
            for (final int index : _pointManager.getIndices()) {
                indexBuffer.put(index);
            }
            points.getMeshData().setIndices(indexBuffer);

            GeometryTool.minimizeVerts(points, EnumSet.noneOf(MatchCondition.class));

            applyCurrentMaterial(points);
            mapToGroups(points);

            points.updateModelBound();

            _root.attachChild(points);
            _pointManager = null;
            _totalPoints++;
        }
View Full Code Here

        _pointCubeShaderState.setUniform("texture", 0);
        _pointCubeShaderState.setUniform("scale", _boxScale);
    }

    private void buildPointSprites() {
        _pointCubes = new Point();
        _pointCubes.setRenderState(_pointCubeShaderState);
        final Texture tex = TextureManager.load("images/cube_map.png", Texture.MinificationFilter.BilinearNoMipMaps,
                TextureStoreFormat.GuessCompressedFormat, true);
        tex.setMagnificationFilter(MagnificationFilter.Bilinear);
        final TextureState ts = new TextureState();
View Full Code Here

        for (int i = 0; i < POINTS; i++) {
            pointData.put((MathUtils.nextRandomFloat() * 12) - 6); // x
            pointData.put((MathUtils.nextRandomFloat() * 12) - 6); // y
            pointData.put((MathUtils.nextRandomFloat() * 10) - 15); // z
        }
        final Point pointsA = new Point("points", pointData, null, null, null);
        pointsA.setRandomColors();
        pointsA.setAntialiased(true);
        pointsA.setPointSize(4.25f);

        final BlendState bState = new BlendState();
        bState.setBlendEnabled(true);
        pointsA.setRenderState(bState);
        _root.attachChild(pointsA);
    }
View Full Code Here

        _pointSpriteShaderState.setUniform("texture", 0);
        _pointSpriteShaderState.setUniform("time", 0f);
    }

    private void buildPointSprites() {
        _pointSprites = new Point(PointType.PointSprite);
        _pointSprites.getSceneHints().setLightCombineMode(LightCombineMode.Off);
        _pointSprites.setRenderState(_pointSpriteShaderState);
        _pointSprites.setPointSize(12);
        final TextureState ts = new TextureState();
        ts.setTexture(TextureManager.load("images/flare.png", Texture.MinificationFilter.NearestNeighborNoMipMaps,
View Full Code Here

        final Line line = new Line("line", vectors, null, null, null);
        line.getMeshData().setIndexMode(IndexMode.LineStrip);
        _root.attachChild(line);

        // Create some points from our vectors
        final Point point = new Point("point", vectors, null, null, null);
        point.setPointSize(10f);
        _root.attachChild(point);

        // Create our controller
        final LinearVector3InterpolationController controller = new LinearVector3InterpolationController();
        controller.setControls(vectors);
View Full Code Here

        line.setRandomColors();

        _root.attachChild(line);

        // Create points from the curve so the actual control points can be easily seen
        final Point point = curve.toRenderablePoint(2);
        point.setPointSize(10f);

        _root.attachChild(point);

        // Create our controller
        final CurveInterpolationController controller = new CurveInterpolationController();
View Full Code Here

            }

            // If we did not find a valid child, the spec says to add verts as a "cloud of points"
            if (!hasChild) {
                logger.warning("No valid child found, creating 'cloud of points'");
                final Point points = buildPoints(colladaGeometry, cMesh);
                if (points != null) {
                    if (points.getName() == null) {
                        points.setName(meshNode.getName() + "_points");
                    }
                    meshNode.attachChild(points);
                }
            }
View Full Code Here

    private Point buildPoints(final Element colladaGeometry, final Element mesh) {
        if (mesh == null || mesh.getChild("vertices") == null || mesh.getChild("vertices").getChild("input") == null) {
            return null;
        }
        final Point points = new Point();
        points.setName(mesh.getAttributeValue("name", mesh.getName()));

        // Find POSITION vertices source
        final Element source = _colladaDOMUtil.getPositionSource(mesh.getChild("vertices"));
        if (source == null) {
            return null;
        }

        if (source.getChild("float_array") != null) {
            // Turn into Floatbuffer if we have float array data
            final Element floatArray = source.getChild("float_array");
            if ("0".equals(floatArray.getAttributeValue("count"))) {
                return null;
            }
            final FloatBuffer vertices = BufferUtils.createFloatBuffer(_colladaDOMUtil.parseFloatArray(floatArray));
            // Add to points
            points.getMeshData().setVertexBuffer(vertices);
        } else if (source.getChild("int_array") != null) {
            // Turn into Floatbuffer if we have int array data
            final Element intArray = source.getChild("int_array");
            if ("0".equals(intArray.getAttributeValue("count"))) {
                return null;
            }
            final int[] data = _colladaDOMUtil.parseIntArray(intArray);
            final FloatBuffer vertices = BufferUtils.createFloatBuffer(data.length);
            for (final int i : data) {
                vertices.put(i);
            }
            // Add to points
            points.getMeshData().setVertexBuffer(vertices);
        }

        // Add to vert mapping
        final int[] indices = new int[points.getMeshData().getVertexCount()];
        for (int i = 0; i < indices.length; i++) {
            indices[i] = i;
        }
        final MeshVertPairs mvp = new MeshVertPairs(points, indices);
        _dataCache.getVertMappings().put(colladaGeometry, mvp);

        if (_optimizeMeshes) {
            final VertMap map = GeometryTool.minimizeVerts(points, _optimizeSettings);
            _dataCache.setMeshVertMap(points, map);
        }

        // Update bound
        points.updateModelBound();

        // return
        return points;
    }
View Full Code Here

TOP

Related Classes of com.ardor3d.scenegraph.Point

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.