コード例 #1
0
 public FractalSplineCylinder()
 {
     Test.Debug( "Cylinder" );
     primitive = new FractalSpline.Cylinder( FractalSpline.RendererOpenGl.GetInstance() );
     LoadDefaults();
 }
コード例 #2
0
        void SetupWorld()
        {
            renderer = new RendererOpenGl();
            Console.WriteLine( renderer );
        #if BOXES
            mybox = new FractalSpline.Box( RendererOpenGl.GetInstance() );
            mybox2 = new FractalSpline.Box( RendererOpenGl.GetInstance() );
            mybox3 = new FractalSpline.Box( RendererOpenGl.GetInstance() );
            mybox4 = new FractalSpline.Box( RendererOpenGl.GetInstance() );
            
            for ( int i = 0; i < 9; i++ )
            {
                mybox.SetTexture( i, TextureIds[i] );
            }
            mybox.Hollow = 70;
            mybox.CutStart = 15;
            mybox.CutEnd = 185;
            mybox.UpdateTransforms();
            
            mybox2.SetTexture(FractalSpline.Primitive.AllFaces, TextureIds[5] );
            mybox2.CutStart = 20;
            mybox2.CutEnd = 175;
            mybox2.Twist = 30;
            mybox2.Shear = 0.3;
            //mybox2.LevelOfDetail =4;
            mybox2.Hollow = 30;
            mybox2.UpdateTransforms();
            
            mybox3.SetTexture(FractalSpline.Primitive.AllFaces, TextureIds[5] );
            mybox3.TextureOffset = new double[]{ 0.25, 0.25 };
            mybox3.TextureScale = new double[]{ 0.5, 0.5 };
            mybox3.TextureRotate = 80;
            mybox3.Twist = 30;
            mybox3.Shear = 0.3;
            mybox3.UpdateTransforms();

            mybox4.SetTexture(FractalSpline.Primitive.AllFaces, TextureIds[5] );
            mybox4.Hollow = 70;
            mybox4.TextureOffset = new double[]{ 0.25, 0.25 };
            mybox4.TextureScale = new double[]{ 0.5, 0.5 };
            mybox4.TextureRotate = 80;
            mybox4.UpdateTransforms();
            #endif

                #if CYLINDERS
            cylinder = new FractalSpline.Cylinder( RendererOpenGl.GetInstance() );
            cylinder.SetTexture(FractalSpline.Primitive.AllFaces, TextureIds[5] );
            
            cylinder2 = new FractalSpline.Cylinder( RendererOpenGl.GetInstance() );
            cylinder2.SetTexture(FractalSpline.Primitive.AllFaces, TextureIds[5] );
            cylinder2.CutStart = 20;
            cylinder2.CutEnd = 185;
            cylinder2.Twist = 45;
            cylinder2.Shear = 0.3;
            //cylinder2.LevelOfDetail =4;
            cylinder2.Hollow = 30;
            cylinder2.UpdateTransforms();
            
            cylinder3 = new FractalSpline.Cylinder( RendererOpenGl.GetInstance() );
            cylinder3.SetTexture(FractalSpline.Primitive.AllFaces, TextureIds[5] );
            cylinder3.Twist = 30;
            cylinder3.Shear = 0.2;
            cylinder3.TextureRotate = 20;
            cylinder3.UpdateTransforms();
            #endif

            #if PRISMS
            prism = new FractalSpline.Prism( renderer );
            for ( int i = 0; i < 9; i++ )
            {
                prism.SetTexture( i, TextureIds[i] );
            }
            prism.TextureRotate = 10;
            
            prism2 = new FractalSpline.Prism( renderer );
            prism2.CutStart = 100;
            prism2.CutEnd = 175;
            prism2.Twist = 90;
            //prism2.LevelOfDetail =4;
            prism2.Hollow = 30;
            prism2.UpdateTransforms();
            prism2.SetTexture(FractalSpline.Primitive.AllFaces, TextureIds[5] );
            prism2.TextureRotate = 30;

            prism3 = new FractalSpline.Prism( renderer );
            prism3.SetTexture(FractalSpline.Primitive.AllFaces, TextureIds[5] );
            prism3.TextureRotate = 30;
            #endif

            #if TUBES
            Console.WriteLine( "tube");
            tube = new FractalSpline.Tube( renderer );
            tube.SetTexture(FractalSpline.Primitive.AllFaces, TextureIds[5] );
            tube.TextureRotate = 30;
            
            Console.WriteLine( "tube2");
            tube2 = new FractalSpline.Tube( renderer );
            tube2.SetTexture(FractalSpline.Primitive.AllFaces, TextureIds[5] );
            tube2.CutStart = 100;
            tube2.CutEnd = 175;
            tube2.Twist = 90;
            //prism2.LevelOfDetail =4;
            tube2.Hollow = 30;
            tube2.HoleSize = 30;
            tube2.AdvancedCutStart = 10;
            tube2.AdvancedCutEnd = 80;
            tube2.TextureRotate = 30;
            tube2.UpdateTransforms();
            
            Console.WriteLine( "tube3");
            tube3 = new FractalSpline.Tube( renderer );
            tube3.SetTexture(FractalSpline.Primitive.AllFaces, TextureIds[5] );
            tube3.TextureRotate = 30;
            #endif
            
            #if RINGS
            ring = new FractalSpline.Ring( renderer );
            ring.SetTexture(FractalSpline.Primitive.AllFaces, TextureIds[5] );
            ring.TextureRotate = 30;
            
            ring2 = new FractalSpline.Ring( renderer );
            ring2.CutStart = 100;
            ring2.CutEnd = 175;
            ring2.Twist = 90;
            //prism2.LevelOfDetail =4;
            ring2.Hollow = 30;
            ring2.HoleSize = 30;
            ring2.AdvancedCutStart = 10;
            ring2.AdvancedCutEnd = 80;
            ring2.UpdateTransforms();
            ring2.SetTexture(FractalSpline.Primitive.AllFaces, TextureIds[5] );
            ring2.TextureRotate = 30;

            ring3 = new FractalSpline.Ring( renderer );
            ring3.SetTexture(FractalSpline.Primitive.AllFaces, TextureIds[5] );
            ring3.TextureRotate = 30;
            #endif
            
            #if TORUSES
            torus = new FractalSpline.Torus( renderer );
            torus.SetTexture(FractalSpline.Primitive.AllFaces, TextureIds[5] );
            torus.TextureRotate = 30;
            
            torus2 = new FractalSpline.Torus( renderer );
            torus2.CutStart = 100;
            torus2.CutEnd = 175;
            torus2.Twist = 90;
            //prism2.LevelOfDetail =4;
            torus2.Hollow = 30;
            torus2.HoleSize = 30;
            torus2.AdvancedCutStart = 10;
            torus2.AdvancedCutEnd = 80;
            torus2.UpdateTransforms();
            torus2.SetTexture(FractalSpline.Primitive.AllFaces, TextureIds[5] );
            torus2.TextureRotate = 30;
            
            torus3 = new FractalSpline.Torus( renderer );
            torus3.SetTexture(FractalSpline.Primitive.AllFaces, TextureIds[5] );
            torus3.TextureRotate = 30;
            #endif
        }
コード例 #3
0
        void SetupWorld()
        {
            renderer = new RendererOpenGl();
            Console.WriteLine(renderer);
        #if BOXES
            mybox  = new FractalSpline.Box(RendererOpenGl.GetInstance());
            mybox2 = new FractalSpline.Box(RendererOpenGl.GetInstance());
            mybox3 = new FractalSpline.Box(RendererOpenGl.GetInstance());
            mybox4 = new FractalSpline.Box(RendererOpenGl.GetInstance());

            for (int i = 0; i < 9; i++)
            {
                mybox.SetTexture(i, TextureIds[i]);
            }
            mybox.Hollow   = 70;
            mybox.CutStart = 15;
            mybox.CutEnd   = 185;
            mybox.UpdateTransforms();

            mybox2.SetTexture(FractalSpline.Primitive.AllFaces, TextureIds[5]);
            mybox2.CutStart = 20;
            mybox2.CutEnd   = 175;
            mybox2.Twist    = 30;
            mybox2.Shear    = 0.3;
            //mybox2.LevelOfDetail =4;
            mybox2.Hollow = 30;
            mybox2.UpdateTransforms();

            mybox3.SetTexture(FractalSpline.Primitive.AllFaces, TextureIds[5]);
            mybox3.TextureOffset = new double[] { 0.25, 0.25 };
            mybox3.TextureScale  = new double[] { 0.5, 0.5 };
            mybox3.TextureRotate = 80;
            mybox3.Twist         = 30;
            mybox3.Shear         = 0.3;
            mybox3.UpdateTransforms();

            mybox4.SetTexture(FractalSpline.Primitive.AllFaces, TextureIds[5]);
            mybox4.Hollow        = 70;
            mybox4.TextureOffset = new double[] { 0.25, 0.25 };
            mybox4.TextureScale  = new double[] { 0.5, 0.5 };
            mybox4.TextureRotate = 80;
            mybox4.UpdateTransforms();
            #endif

                #if CYLINDERS
            cylinder = new FractalSpline.Cylinder(RendererOpenGl.GetInstance());
            cylinder.SetTexture(FractalSpline.Primitive.AllFaces, TextureIds[5]);

            cylinder2 = new FractalSpline.Cylinder(RendererOpenGl.GetInstance());
            cylinder2.SetTexture(FractalSpline.Primitive.AllFaces, TextureIds[5]);
            cylinder2.CutStart = 20;
            cylinder2.CutEnd   = 185;
            cylinder2.Twist    = 45;
            cylinder2.Shear    = 0.3;
            //cylinder2.LevelOfDetail =4;
            cylinder2.Hollow = 30;
            cylinder2.UpdateTransforms();

            cylinder3 = new FractalSpline.Cylinder(RendererOpenGl.GetInstance());
            cylinder3.SetTexture(FractalSpline.Primitive.AllFaces, TextureIds[5]);
            cylinder3.Twist         = 30;
            cylinder3.Shear         = 0.2;
            cylinder3.TextureRotate = 20;
            cylinder3.UpdateTransforms();
            #endif

            #if PRISMS
            prism = new FractalSpline.Prism(renderer);
            for (int i = 0; i < 9; i++)
            {
                prism.SetTexture(i, TextureIds[i]);
            }
            prism.TextureRotate = 10;

            prism2          = new FractalSpline.Prism(renderer);
            prism2.CutStart = 100;
            prism2.CutEnd   = 175;
            prism2.Twist    = 90;
            //prism2.LevelOfDetail =4;
            prism2.Hollow = 30;
            prism2.UpdateTransforms();
            prism2.SetTexture(FractalSpline.Primitive.AllFaces, TextureIds[5]);
            prism2.TextureRotate = 30;

            prism3 = new FractalSpline.Prism(renderer);
            prism3.SetTexture(FractalSpline.Primitive.AllFaces, TextureIds[5]);
            prism3.TextureRotate = 30;
            #endif

            #if TUBES
            Console.WriteLine("tube");
            tube = new FractalSpline.Tube(renderer);
            tube.SetTexture(FractalSpline.Primitive.AllFaces, TextureIds[5]);
            tube.TextureRotate = 30;

            Console.WriteLine("tube2");
            tube2 = new FractalSpline.Tube(renderer);
            tube2.SetTexture(FractalSpline.Primitive.AllFaces, TextureIds[5]);
            tube2.CutStart = 100;
            tube2.CutEnd   = 175;
            tube2.Twist    = 90;
            //prism2.LevelOfDetail =4;
            tube2.Hollow           = 30;
            tube2.HoleSize         = 30;
            tube2.AdvancedCutStart = 10;
            tube2.AdvancedCutEnd   = 80;
            tube2.TextureRotate    = 30;
            tube2.UpdateTransforms();

            Console.WriteLine("tube3");
            tube3 = new FractalSpline.Tube(renderer);
            tube3.SetTexture(FractalSpline.Primitive.AllFaces, TextureIds[5]);
            tube3.TextureRotate = 30;
            #endif

            #if RINGS
            ring = new FractalSpline.Ring(renderer);
            ring.SetTexture(FractalSpline.Primitive.AllFaces, TextureIds[5]);
            ring.TextureRotate = 30;

            ring2          = new FractalSpline.Ring(renderer);
            ring2.CutStart = 100;
            ring2.CutEnd   = 175;
            ring2.Twist    = 90;
            //prism2.LevelOfDetail =4;
            ring2.Hollow           = 30;
            ring2.HoleSize         = 30;
            ring2.AdvancedCutStart = 10;
            ring2.AdvancedCutEnd   = 80;
            ring2.UpdateTransforms();
            ring2.SetTexture(FractalSpline.Primitive.AllFaces, TextureIds[5]);
            ring2.TextureRotate = 30;

            ring3 = new FractalSpline.Ring(renderer);
            ring3.SetTexture(FractalSpline.Primitive.AllFaces, TextureIds[5]);
            ring3.TextureRotate = 30;
            #endif

            #if TORUSES
            torus = new FractalSpline.Torus(renderer);
            torus.SetTexture(FractalSpline.Primitive.AllFaces, TextureIds[5]);
            torus.TextureRotate = 30;

            torus2          = new FractalSpline.Torus(renderer);
            torus2.CutStart = 100;
            torus2.CutEnd   = 175;
            torus2.Twist    = 90;
            //prism2.LevelOfDetail =4;
            torus2.Hollow           = 30;
            torus2.HoleSize         = 30;
            torus2.AdvancedCutStart = 10;
            torus2.AdvancedCutEnd   = 80;
            torus2.UpdateTransforms();
            torus2.SetTexture(FractalSpline.Primitive.AllFaces, TextureIds[5]);
            torus2.TextureRotate = 30;

            torus3 = new FractalSpline.Torus(renderer);
            torus3.SetTexture(FractalSpline.Primitive.AllFaces, TextureIds[5]);
            torus3.TextureRotate = 30;
            #endif
        }
コード例 #4
0
 public FractalSplineCylinder()
 {
     Test.Debug("Cylinder");
     primitive = new FractalSpline.Cylinder(FractalSpline.RendererOpenGl.GetInstance());
     LoadDefaults();
 }