コード例 #1
0
        public Building()
        {
            floors = new List<LitMatrixBlock2>();
            float x = (float)random.NextDouble() * 2f - 1f;
            float z = (float)random.NextDouble() * 2;
            center = new Vector3(x * offsetScale.X, 0, z * offsetScale.Z);
            stories = random.Next(maxStories);
            for (int i = 0; i < stories; i++)
            {
                LitMatrixBlock2 newFloor = new LitMatrixBlock2(new Vector3(0.2f, 0.2f, 0.2f), Colors.BLUE_COLOR);
                newFloor.SetOffset(center + new Vector3(0f, i * 0.2f, 0f));
                floors.Add(newFloor);

            }

            x = (float)random.NextDouble()/4;
            z = (float)random.NextDouble()/8;
        }
コード例 #2
0
 public Alien()
 {
     body = new LitMatrixSphere2(radius);
     leftWing = new LitMatrixBlock2(new Vector3(radius/5, 2 * radius, 2 * radius), Colors.RED_COLOR);
     leftWing.SetOffset(new Vector3(-radius, 0f, 0f));
     rightWing = new LitMatrixBlock2(new Vector3(radius/5, 2 * radius, 2 * radius), Colors.RED_COLOR);
     rightWing.SetOffset(new Vector3(-radius, 0f, 0f));
     float xOffset = random.Next(20)/10f - 1f;
     float yOffset = random.Next(20)/10f - 1f;
     float zOffset = random.Next(10)/10f - 0.5f;
     int colorSelection = random.Next(3);
     switch (colorSelection)
     {
         case 0:
             body.SetColor(Colors.RED_COLOR);
             leftWing.SetColor(Colors.RED_COLOR);
             rightWing.SetColor(Colors.RED_COLOR);
             break;
         case 1:
             body.SetColor(Colors.GREEN_COLOR);
             leftWing.SetColor(Colors.GREEN_COLOR);
             rightWing.SetColor(Colors.GREEN_COLOR);
             break;
         case 2: body.SetColor(Colors.BLUE_COLOR);
             leftWing.SetColor(Colors.BLUE_COLOR);
             rightWing.SetColor(Colors.BLUE_COLOR);
             break;
         default:
             body.SetColor(Colors.YELLOW_COLOR);
             leftWing.SetColor(Colors.YELLOW_COLOR);
             rightWing.SetColor(Colors.YELLOW_COLOR);
             break;
     }
     xOffset = xOffset * scale;
     yOffset = yOffset * scale;
     zOffset = zOffset * scale;
     body.SetOffset(new Vector3(xOffset, yOffset, zOffset));
 }
コード例 #3
0
 protected override void init()
 {
     lmb2 = new LitMatrixBlock2(new Vector3 (0.05f, 1f, 0.05f), Colors.GREEN_COLOR);
     axis = new Vector3(0f, 1f, 0f);
     lmb2.SetAxis(axis);
 }
コード例 #4
0
        protected override void init()
        {
            lms1 = new LitMatrixSphere2(0.2f);
            lms2 = new LitMatrixSphere2(0.2f);
            lms2.SetOffset(new Vector3(-0.5f, 0f, 0f));
            lms2.SetColor(0f, 1f, 0f);

            Vector3 size = new Vector3(0.1f, 0.1f, 0.1f);
            Vector3 offset = new Vector3(0.5f, 0.025f, 0f);
            Vector3 axis = new Vector3(1f, 1f, 1f);

            lmb2 = new LitMatrixBlock2(size, Colors.BLUE_COLOR);
            lmb2.SetOffset(offset);
            lmb2.SetAxis(axis);

            SetupDepthAndCull();
        }