0
나는 녹색 삼각형을 그리려하고있다. 나는 그릴 삼각형을 얻을 수 있었지만 녹색 대신 흰색이었다. 이 문제의 원인은 누구에게 있습니까?왜 삼각형이 흰색입니까?
protected override void LoadContent()
{
_vertexPositionColors = new[]
{
new VertexPositionColor(new Vector3(0, 0, 0), Color.Green),
new VertexPositionColor(new Vector3(100, 0, 0), Color.Red),
new VertexPositionColor(new Vector3(100, 100, 0), Color.Blue)
};
_basicEffect = new BasicEffect(GraphicsDevice);
_basicEffect.World = Matrix.CreateOrthographicOffCenter(
0, GraphicsDevice.Viewport.Width, GraphicsDevice.Viewport.Height, 0, 0, 1);
_basicEffect.LightingEnabled = false;
_basicEffect.VertexColorEnabled = true;
}
protected override void Draw(GameTime gameTime)
{
GraphicsDevice.Clear(Color.CornflowerBlue);
EffectTechnique effectTechnique = _basicEffect.Techniques[0];
EffectPassCollection effectPassCollection = effectTechnique.Passes;
foreach (EffectPass pass in effectPassCollection)
{
pass.Apply();
GraphicsDevice.DrawUserPrimitives(PrimitiveType.TriangleList, _vertexPositionColors, 0, 1);
}
base.Draw(gameTime);
}
고쳐주었습니다. 감사 – Wipie44