2011-08-31 68 views

回答

0

要爲VertexPositionColor []設置動畫效果,您真正需要做的就是適當修改數組的元素,然後在DrawUserPrimitives()調用中使用新值。

例如,在你的遊戲的更新方法:

for (int index = 0; index < vertices.Length; ++index) 
{ 
    vertices[ index ].Color *= (float)System.Math.Sin(gameTime.ElapsedGameTime.Seconds/60); 
}