public override void Draw(Camera3D camera) { PointBatch.Begin(Matrix.Identity, camera); for (int i = 0; i < starCount; i++) { PointBatch.Draw(points[i], starRadius, new Color(brightnesses[i], brightnesses[i], brightnesses[i])); } PointBatch.End(); }
public override void Draw(Camera3D camera) { if (Alive) { Matrix translationMatrix = Matrix.CreateTranslation(Position); LineBatch.Begin(translationMatrix, camera); for (int i = 0; i < vertices.Count; i++) { LineBatch.Draw(vertices[i], vertices[(i + 1) % vertices.Count], 2.5f, lineColor); } LineBatch.End(); PointBatch.Begin(translationMatrix, camera); PointBatch.Draw(lightPosition, 15.0f, lightColor); PointBatch.End(); } }
public override void Draw(Camera3D camera) { // draw ship if (Alive) { Matrix rotationMatrix = Matrix.CreateRotationZ(Rotation); Matrix translationMatrix = Matrix.CreateTranslation(Position); LineBatch.Begin(rotationMatrix * translationMatrix, camera); for (int i = 0; i < vertices.Count; i++) { LineBatch.Draw(vertices[i], vertices[(i + 1) % vertices.Count], lineWidth, lineColor); } LineBatch.End(); PointBatch.Begin(translationMatrix, camera); PointBatch.Draw(lightPosition, lightRadius, lightColor); PointBatch.End(); } }