Ejemplo n.º 1
0
 public virtual void Draw(Camera c)
 {
     Vector3 clr;
     if (selected)
     {
         clr = new Vector3(1, 0, 0);
         selected = false;
     }
     else
         clr = color;
     ((BasicEffect)model.Meshes[0].Effects[0]).DiffuseColor = clr;
     ((BasicEffect)model.Meshes[0].Effects[0]).Alpha = alpha;
     c.render(model, Matrix.CreateTranslation(currentPos), aTrans);
 }
Ejemplo n.º 2
0
        public void DrawLabel(Camera c)
        {
            nameTag.cam = c;

            ((BasicEffect)label.Meshes[1].Effects[0]).Texture = avatar;
            ((BasicEffect)label.Meshes[2].Effects[0]).Texture = avatar;
            c.render(label, Matrix.CreateTranslation(0, -5, 0)
                * Matrix.CreateRotationX(-c.Rotation.Y / 2 + MathHelper.PiOver4)
                * Matrix.CreateTranslation(0, 5, index == 0 ? 30 : -30), labelTrans);

            nameTag.Draw(Matrix.CreateTranslation(0, -5, 0)
                * Matrix.CreateScale(0.2f)
                * Matrix.CreateRotationY(index == 0 ? 0 : MathHelper.Pi)
                * Matrix.CreateRotationX(-c.Rotation.Y / 2 + MathHelper.PiOver4)
                * Matrix.CreateTranslation(index == 0 ? -8 : 8, 5, index == 0 ? 31 : -31), Color.Green);
            nameTag.Draw(Matrix.CreateTranslation(0, -5, 0)
                * Matrix.CreateScale(0.2f)
                * Matrix.CreateRotationY(index == 1 ? 0 : MathHelper.Pi)
                * Matrix.CreateRotationX(-c.Rotation.Y / 2 + MathHelper.PiOver4)
                * Matrix.CreateTranslation(index == 1 ? -8 : 8, 5, index == 0 ? 29 : -29), Color.Green);
        }
Ejemplo n.º 3
0
        public void Draw(Camera c)
        {
            ((BasicEffect)model.Meshes[0].Effects[0]).DirectionalLight0.Direction =
                Vector3.Negate(Vector3.Normalize(c.position));

            c.render(model, Matrix.Identity, aTrans);
            for (int i = 0; i < 8; i++)
                for (int j = 0; j < 8; j++)
                    tiles[i][j].Draw(c);
        }