예제 #1
0
        private void CreateShapes()
        {
            //  Create some shapes...
            int shapeCount = random.Next(2, 5);

            for (int i = 0; i < shapeCount; i++)
            {
                //  Create the shape.
                var shape = new CrazyShape {
                    Red = RandomFloat(), Green = RandomFloat(), Blue = RandomFloat()
                };

                //  Create the points.
                int pointCount = random.Next(3, 6);
                for (int j = 0; j < pointCount; j++)
                {
                    shape.Points.Add(new ShapePoint
                    {
                        Position = new Vertex(RandomFloat() * (float)openGLControl1.ActualWidth,
                                              RandomFloat() * (float)openGLControl1.ActualHeight, 0),
                        Velocity = new Vertex(RandomFloat(1f, 10f), RandomFloat(1f, 10f), 0)
                    });
                }

                //  Add the shape.
                shapes.Add(shape);
            }
        }
예제 #2
0
        private void CreateShapes()
        {
            //  Create some shapes...
            int shapeCount = random.Next(2, 5);
            for(int i = 0; i < shapeCount; i++)
            {
                //  Create the shape.
                var shape = new CrazyShape{Red = RandomFloat(), Green = RandomFloat(),Blue = RandomFloat()};

                //  Create the points.
                int pointCount = random.Next(3, 6);
                for(int j=0; j < pointCount; j++)
                    shape.Points.Add(new ShapePoint
                                         {
                                             Position = new Vertex(RandomFloat()*(float) openGLControl1.ActualWidth,
                                                 RandomFloat()*(float) openGLControl1.ActualHeight, 0),
                                             Velocity = new Vertex(RandomFloat(1f, 10f), RandomFloat(1f, 10f), 0)
                                         });

                //  Add the shape.
                shapes.Add(shape);
            }
        }