Пример #1
0
        public void GenerateGeometry(SharpGL.OpenGL gl)
        {
            HighlightCube.GenerateGeometry(gl);

            const float spacing = 1 + CubeSpacing;

            for (int z = 0; z < Size; z++)
            {
                for (int y = 0; y < Size; y++)
                {
                    for (int x = 0; x < Size; x++)
                    {
                        var cube = new Cube(Colors.Black);
                        ColourCubeFromConfiguration(cube, x, y, z);
                        cube.GenerateGeometry(gl);

                        var position = new Vector3(x * spacing, y * spacing, z * spacing);
                        position += m_cubieCentre;  // Centre
                        string id = string.Format("{0},{1},{2}", x - 1, y - 1, z - 1);
                        var cubie = new Cubie(id, cube, position);
                        AddToConfiguration(cubie, x, y, z);
                        m_animators.Add(new CubieAnimator(cubie));
                    }
                }
            }

            CubeConfiguration.CheckValid();
        }