Skip to content

Instantly share code, notes, and snippets.

@kenpower
Created March 7, 2013 11:48
Show Gist options
  • Save kenpower/5107513 to your computer and use it in GitHub Desktop.
Save kenpower/5107513 to your computer and use it in GitHub Desktop.
Orient a missile
public override void Draw(GameTime gametime, Camera camera)
{
Matrix orientation = Matrix.CreateFromYawPitchRoll(yawAngle, 0, 0);
Matrix world = orientation * Matrix.CreateTranslation(position);
foreach (ModelMesh m in model.Meshes)
{
foreach (BasicEffect e in m.Effects)
{
e.EnableDefaultLighting();
e.World = world;
e.Projection = camera.Projection;
e.View = camera.View;
}
m.Draw();
}
base.Draw(gametime, camera);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment