Exemple #1
0
 /// <summary>
 /// 立方体の GeometricPrimitive を生成します。
 /// </summary>
 /// <param name="size"></param>
 /// <returns>生成された立方体の GeometricPrimitive。</returns>
 GeometricPrimitive CreateCubePrimitive(float size)
 {
     var cube = new Cube { Size = size };
     var source = new VertexSource<VertexPositionNormal, ushort>();
     cube.Make(source);
     return GeometricPrimitive.Create(graphicsDevice, source);
 }
 /// <summary>
 /// 立方体の GeometricPrimitive を生成します。
 /// </summary>
 /// <returns>生成された立方体の GeometricPrimitive。</returns>
 GeometricPrimitive CreateCubePrimitive()
 {
     var cube = new Cube
     {
         Size = 1,
         BackwardColor = Color.Blue,
         ForwardColor = Color.BlueViolet,
         RightColor = Color.OrangeRed,
         LeftColor = Color.Red,
         UpColor = Color.Green,
         DownColor = Color.GreenYellow
     };
     var source = new VertexSource<VertexPositionNormalColor, ushort>();
     cube.Make(source);
     return Graphics.GeometricPrimitive.Create(Screen.GraphicsDevice, source);
 }