Package com.ardor3d.scenegraph

Examples of com.ardor3d.scenegraph.Line


            final ReadOnlyColorRGBA color, final short pattern, final boolean drawOriginConnector) {
        if (lineFrustum == null) {
            final FloatBuffer verts = BufferUtils.createVector3Buffer(24);
            final FloatBuffer colors = BufferUtils.createColorBuffer(24);

            lineFrustum = new Line("Lines", verts, null, colors, null);
            lineFrustum.getMeshData().setIndexModes(
                    new IndexMode[] { IndexMode.LineLoop, IndexMode.LineLoop, IndexMode.Lines, IndexMode.Lines });
            lineFrustum.getMeshData().setIndexLengths(new int[] { 4, 4, 8, 8 });
            lineFrustum.setLineWidth(2);
            lineFrustum.getSceneHints().setLightCombineMode(LightCombineMode.Off);
View Full Code Here


        for (int y = 0, i = 0; i < verts.capacity(); i += 6, y += div) {
            verts.put(0).put(y).put(0);
            verts.put(texWidth).put(y).put(0);
        }

        _horizontals = new Line("horiz", verts, null, null, null);
        _horizontals.getMeshData().setIndexMode(IndexMode.Lines);
        _horizontals.getSceneHints().setRenderBucketType(RenderBucketType.Ortho);

        _horizontals.setDefaultColor(getColorConfig(LineGrapher.Horizontal, ConfigKeys.Color.name(), new ColorRGBA(
                ColorRGBA.BLUE)));
View Full Code Here

        for (float x = _vSpan; x <= texWidth + _vSpan; x += _vSpan) {
            verts.put(x).put(0).put(0);
            verts.put(x).put(texHeight).put(0);
        }

        _verticals = new Line("vert", verts, null, null, null);
        _verticals.getMeshData().setIndexMode(IndexMode.Lines);
        _verticals.getSceneHints().setRenderBucketType(RenderBucketType.Ortho);

        _verticals.setDefaultColor(getColorConfig(LineGrapher.Vertical, ConfigKeys.Color.name(), new ColorRGBA(
                ColorRGBA.RED)));
View Full Code Here

        }
    }

    public Line updateLineKey(final StatType type, Line lineKey) {
        if (lineKey == null) {
            lineKey = new Line("lk", BufferUtils.createVector3Buffer(2), null, null, null);
            final FloatBuffer fb = BufferUtils.createFloatBuffer(new Vector3[] { new Vector3(0, 0, 0),
                    new Vector3(30, 0, 0) });
            fb.rewind();
            lineKey.getMeshData().setVertexBuffer(fb);
        }
View Full Code Here

            point.setAntialiased(getBooleanConfig(type, ConfigKeys.Antialias.name(), true));
            if (!getBooleanConfig(type, ConfigKeys.ShowPoints.name(), false)) {
                point.getSceneHints().setCullHint(CullHint.Always);
            }

            line = new Line("l", BufferUtils.createVector3Buffer(maxSamples), null, null, null);
            line.getSceneHints().setRenderBucketType(RenderBucketType.Ortho);
            line.getMeshData().setIndexMode(IndexMode.LineStrip);

            line.setDefaultColor(getColorConfig(type, ConfigKeys.Color.name(), new ColorRGBA(ColorRGBA.LIGHT_GRAY)));
            line.setLineWidth(getIntConfig(type, ConfigKeys.Width.name(), 3));
View Full Code Here

        for (int y = 0, i = 0; i < verts.capacity(); i += 6, y += div) {
            verts.put(0).put(y).put(0);
            verts.put(texWidth).put(y).put(0);
        }

        _horizontals = new Line("horiz", verts, null, null, null);
        _horizontals.getMeshData().setIndexMode(IndexMode.Lines);
        _horizontals.getSceneHints().setRenderBucketType(RenderBucketType.Ortho);

        _horizontals.setDefaultColor(getColorConfig(TimedAreaGrapher.Horizontal, ConfigKeys.Color.name(),
                new ColorRGBA(ColorRGBA.BLUE)));
View Full Code Here

        for (float x = _vSpan; x <= texWidth + _vSpan; x += _vSpan) {
            verts.put(x).put(0).put(0);
            verts.put(x).put(texHeight).put(0);
        }

        _verticals = new Line("vert", verts, null, null, null);
        _verticals.getMeshData().setIndexMode(IndexMode.Lines);
        _verticals.getSceneHints().setRenderBucketType(RenderBucketType.Ortho);

        _verticals.setDefaultColor(getColorConfig(TimedAreaGrapher.Vertical, ConfigKeys.Color.name(), new ColorRGBA(
                ColorRGBA.RED)));
View Full Code Here

        }
    }

    public Line updateLineKey(final StatType type, Line lineKey) {
        if (lineKey == null) {
            lineKey = new Line("lk", BufferUtils.createVector3Buffer(2), null, null, null);
            final FloatBuffer fb = BufferUtils.createFloatBuffer(new Vector3[] { new Vector3(0, 0, 0),
                    new Vector3(30, 0, 0) });
            fb.rewind();
            lineKey.getMeshData().setVertexBuffer(fb);
        }
View Full Code Here

        final Vector3[] vertex = toVector3(start, end, steps);
        final Vector3[] normal = null;
        final ColorRGBA[] color = null;
        final Vector2[] texture = null;

        final Line line = new Line("curve", vertex, normal, color, texture);

        line.getMeshData().setIndexMode(IndexMode.LineStrip);

        return line;
    }
View Full Code Here

                    hasUVs = true;
                }
                i++;
            }

            final Line line = new Line(name, vertices, null, null, hasUVs ? uvs : null);
            final IndexBufferData<? extends Buffer> indexBuffer = BufferUtils.createIndexBufferData(_lineManager
                    .getIndices().size(), vertices.length - 1);
            for (final int index : _lineManager.getIndices()) {
                indexBuffer.put(index);
            }
            line.getMeshData().setIndices(indexBuffer);
            if (_lineManager.getLengths().size() > 1) {
                final int[] lengths = new int[_lineManager.getLengths().size()];
                i = 0;
                for (final int l : _lineManager.getLengths()) {
                    lengths[i++] = l;
                }
                line.getMeshData().setIndexLengths(lengths);
            }
            GeometryTool.minimizeVerts(line, EnumSet.of(MatchCondition.UVs));

            applyCurrentMaterial(line);
            mapToGroups(line);

            line.updateModelBound();

            _root.attachChild(line);
            _lineManager = null;
            _totalLines++;
        }
View Full Code Here

TOP

Related Classes of com.ardor3d.scenegraph.Line

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.