Example #1
0
        public string exportX3D(Scientrace.Object3dEnvironment env)
        {
            Scientrace.Vector a, b, c, d;
            //square
            a = Vector.ZeroVector();
            b = this.plane.u;
            c = this.plane.u + this.plane.v;
            d = this.plane.v;

            string colstr = "0.5 0.5 0.5 0.2";

            return(@"<!-- Start Parallelogram instance -->\n <Transform translation='" + this.plane.loc.trico() + @"'>
<Shape>
<!-- Coordinate prism sequence (matches coordIndex actually) 0 1 2 3 0 -->
<LineSet vertexCount='5'>
<Coordinate point='
" + a.tricon() + b.tricon() + c.tricon() + d.tricon() + a.tricon() + "'/>" +

                   /*@"<ColorRGBA color='0 1 0 1 0 1 0 1
                    * 0 1 0 1 0 1 0 1
                    * 0 1 0 1 0 1 0 1
                    * 0 1 0 1 0 1 0 1' />
                    * </LineSet>" + */
                   @"<ColorRGBA color='" + colstr + " " + colstr + " " + colstr + " " + colstr + " " + colstr + " " + colstr + " " + colstr + " " + colstr + @"' />	
</LineSet>" +
                   @"      </Shape>" +
                   @"    </Transform>\n<!-- End Parallelogram instance -->");
        }
        public override string exportX3D(Scientrace.Object3dEnvironment env)
        {
// prev after Transform      <Viewpoint description='	LineSet cube close up' position='0 0 5'/>
            //TODO: try to transform to indexedlineset
            Scientrace.Vector a, b, c, d, e, f, g, h;

            a = Vector.ZeroVector();
            //front square
            b = this.width;
            c = this.height + this.width;
            d = this.height;
            e = this.length;
            //back square
            f = this.length + this.width;
            g = this.length + this.width + this.height;
            h = this.length + this.height;

            //front square

            //back square

            //connecting squares



            return("<!-- Start RectangularPrism instance -->\n<Transform translation='" + this.loc.trico() +
                   "'>\r\n      <Shape>\r\n        <!-- Coordinate rectangprism sequence (matches coordIndex actually) 0 1 2 3 0, 4 5 6 7 4, 0 4, 1 5, 2 6, 3 7 -->\r\n" +
                   "        <LineSet vertexCount='5 5 2 2 2 2'>\r\n          <Coordinate point='\r\n" +
                   a.tricon() + b.tricon() + c.tricon() + d.tricon() + a.tricon() + e.tricon() + f.tricon() + g.tricon() + h.tricon() + e.tricon() + a.tricon() + e.tricon() + b.tricon() + f.tricon() + c.tricon() + g.tricon() + d.tricon() + h.tricon() +
                   "'/>\r\n" +
                   "<ColorRGBA color='" + string.Concat(Enumerable.Repeat("0.5 0.5 0.5 1 ", 18)) + "' />" +         // 18 due to 12 lines in 6 blocks produces 12+6=18, anyway this works?
                   "        </LineSet>\r\n      </Shape>\r\n    </Transform>\n<!-- End RectangularPrism instance -->");
//          <Color color='1 0 0 1 0.5 0 1 1 0 0 1 0 1 0 0 0 0 1 0.8 0 0.8 0.3 0 0.3 1 1 1 0 0 1 1 0 0 0 0 1 1 0.5 0 0.8 0 0.8 1 1 0 0.3 0 0.3 0 1 0 1 1 1'/>
        }
Example #3
0
        public override string exportX3D(Scientrace.Object3dEnvironment env)
        {
            Scientrace.Vector a, b, c, d;
            //square
            a = Vector.ZeroVector();
            b = this.parallelogram.plane.u;
            c = this.parallelogram.plane.u + this.parallelogram.plane.v;
            d = this.parallelogram.plane.v;
//		return this.x3d_fill?
            return((this.x3d_fill_emissive_color != null || this.x3d_fill_diffuse_color != null || this.hasBitmap())?
                   this.exportX3DFilledSurface(a, b, c, d) + this.exportX3DLineSet(a, b, c, d)
//			this.exportX3DFilledSurface(a,b,c,d)
                        :this.exportX3DLineSet(a, b, c, d));
        }        //end exportX3D
Example #4
0
        public override string exportX3D(Scientrace.Object3dEnvironment env)
        {
// prev after Transform      <Viewpoint description='LineSet cube close up' position='0 0 5'/>
            //TODO: try to transform to indexedlineset
            Scientrace.Vector a, b, c, d, e, f;
            a = Vector.ZeroVector();
            //front triangle
            b = this.width;
            c = this.height;
            d = this.length;
            //back triangle
            e = this.length + this.width;
            f = this.length + this.height;
            //front triangle

            //back triangle

            //connecting squares

            //Console.WriteLine("Doublecheck: "+this.loc.trico());

            return("<!-- Start TriangularPrism instance -->\n<Transform translation='" + this.loc.trico() + "'>" +
                   "<Shape>" +
                   "<!-- Coordinate triangprism sequence (matches coordIndex actually) 0 1 2 3 0, 4 5 6 7 4, 0 4, 1 5, 2 6, 3 7 -->" +
                   @"        <LineSet vertexCount='4 4 2 2 2'>" +
                   "<Coordinate point='"
                   + a.tricon() + b.tricon() + c.tricon() + a.tricon() + d.tricon() + e.tricon() + f.tricon() + d.tricon() + a.tricon() + d.tricon() + b.tricon() + e.tricon() + c.tricon() + f.tricon() + "'/>" +
                   @"<ColorRGBA color='0.8 0.5 0 1
0.8 0.5 0 1
0.8 0.5 0 1
0.8 0.5 0 1
0.8 0.5 0 1
0.8 0.5 0 1
0.8 0.5 0 1
0.8 0.5 0 1
0.8 0.5 0 1
0.8 0.5 0 1
0.8 0.5 0 1
0.8 0.5 0 1
0.8 0.5 0 1
0.8 0.5 0 1' />" +
                   "</LineSet>" +
                   "</Shape>" +
                   "</Transform>\n<!-- End TriangularPrism instance -->");
//          <Color color='1 0 0 1 0.5 0 1 1 0 0 1 0 tri 0 0 0 0 1 0.8 0 0.8 0.3 0 0.3 1 1 1 0 0 1 1 0 0 0 0 1 1 0.5 0 0.8 0 0.8 1 1 0 0.3 0 0.3 0 1 0 1 1 1'/>
        }