Пример #1
0
        public void EnableRendering(Vector3 origin)
        {
            Vector3[] lineColors;
            int[]     lineIndicies;

            bboxShader = ShaderCompiler.BuildDefaultShader();
            bboxShader.Link();

            lineColors   = null;
            lineIndicies = null;

            lines(LineColor, 12, out lineColors, out lineIndicies);

            _geo                 = new Box.BoxGeometry();
            _pack                = new PackedGeometry();
            _pack.Coloring       = true;
            _pack._indices       = _geo.Indices;
            _pack._coords        = _geo.Vertices;
            _pack.color          = X3DTypeConverters.Vec3ToFloatArray(lineColors);
            _pack._colorIndicies = lineIndicies;
            _pack.restartIndex   = -1;
            _pack.Interleave();
            _handle = _pack.CreateHandle();

            renderingEnabled = _handle.HasGeometry;

            InitBoundaryPoints(origin);
        }
Пример #2
0
        public void InitBoundaryPoints(Vector3 origin)
        {
            int[]     colIndicies;
            Vector3[] verticies;
            Vector3[] pointColors;
            int[]     indicies;

            boundaries(origin, new Vector3(1, 0, 0), out pointColors, out colIndicies, out indicies, out verticies);

            var _pb = new PackedGeometry();

            _pb.Coloring       = true;
            _pb._indices       = indicies;
            _pb._coords        = verticies;
            _pb.color          = X3DTypeConverters.Vec3ToFloatArray(pointColors);
            _pb._colorIndicies = colIndicies;
            _pb.restartIndex   = -1;
            _pb.Interleave();
            _handlepb = _pb.CreateHandle();
        }