public static void Draw(Matrix world, Matrix view, Matrix projection, Color newcolor, float scale, bool isPopulated, float curAngle)
{
// Set BasicEffect parameters.
Matrix worldMatrix = Matrix.CreateScale(scale) *
Matrix.CreateRotationZ( (float) ((curAngle / 360.0) * 2 * Math.PI)) *
world;
basicEffect.World = worldMatrix;
basicEffect.View = view;
basicEffect.Projection = projection;
basicEffect.DiffuseColor = newcolor.ToVector3();
//basicEffect.VertexColorEnabled = true;
//basicEffect.Alpha = color.A / 255.0f;
basicEffect.EmissiveColor = newcolor.ToVector3();
GraphicsDevice device = basicEffect.GraphicsDevice;
device.DepthStencilState = DepthStencilState.Default;
device.BlendState = BlendState.AlphaBlend;
// Draw the model, using BasicEffect.
if (isPopulated)
{
foreach (ModelMesh mesh in poplulatedPlanet.Meshes)
{
mesh.Draw();
}
}
else
{
foreach (ModelMesh mesh in unpoplulatedPlanet.Meshes)
{
mesh.Draw();
}
}
}