GetVertices() public static method

Gets sphere vertices.
public static GetVertices ( int iterations = 4 ) : System.Vector4[]
iterations int
return System.Vector4[]
Esempio n. 1
0
        /// <summary>
        ///
        /// </summary>
        public override void Initialize()
        {
            skyCube     = new RenderTargetCube(device, ColorFormat.Rgba16F, 128, true);
            skyConstsCB = new ConstantBuffer(device, typeof(SkyConsts));

            LoadContent();

            Game.Reloading += (s, e) => LoadContent();


            var skySphere = SkySphere.GetVertices(4).Select(v => new SkyVertex {
                Vertex = v
            }).ToArray();

            skyVB = new VertexBuffer(Game.GraphicsDevice, typeof(SkyVertex), skySphere.Length);
            skyVB.SetData(skySphere);


            randVectors = new Vector3[64];

            for (int i = 0; i < randVectors.Length; i++)
            {
                Vector3 randV;
                do
                {
                    randV = rand.NextVector3(-Vector3.One, Vector3.One);
                } while (randV.Length() > 1 && randV.Y < 0);

                randVectors[i] = randV.Normalized();
            }
        }