示例#1
0
 public override void Draw(Matrix world, Matrix view, Matrix projection, Camera cam)
 {
     if (this.Visible)
     {
         base.Draw(world, view, projection, cam);
     }
 }
示例#2
0
        public override void Draw(Matrix world, Matrix view, Matrix projection, Camera cam)
        {
            left.Draw(world, view, projection, cam);
            right.Draw(world, view, projection, cam);

            up.Draw(world, view, projection, cam);
            down.Draw(world, view, projection, cam);
        }
示例#3
0
 public void Draw(Matrix world, Matrix view, Matrix projection, Camera cam)
 {
     for (int i = 0; i < Height; i++)
     {
         for (int j = 0; j < Width; j++)
         {
             elements[i][j].Draw(world, view, projection, cam);
         }
     }
 }
示例#4
0
        protected override void Initialize()
        {
            // TODO: Add your initialization logic here

            camera = new Camera(new Vector3(0.0f, 6.0f, 25.0f), new Vector3(0f, 6f, 0f), Vector3.Up);
            pos = camera.Position;
            rot = Vector3.Zero;

            this.CreateCamera();

            float width = 10f;
            float height = 3f;

            float interval = 0f;
            float startX = - (width / 2f);
            float rackY = 0;
            float startY = rackY + 9;

            grid = new Grid(new Vector2(width, height), new Vector3(startX, startY, 0.0f), new Vector3(1f, 1f, 1f), interval);
            rack = new Pong(new Vector3(0, rackY, 0), new Vector3(1f, 1f, 1f));
            ball = new Ball(new Vector3(0, 0, 0), new Vector3(0.60f, 0.60f, 0.60f), 0.07f);

            terrain = new Terrain(new Vector3(-0.5f, 6, 0), new Vector3(12f, 15f, 0f));

            Vector3 loc = rack.Location;
            loc.Y = rack.Location.Y + rack.Scale.Y / 8 + ball.Scale.Y / 2;
            ball.Location = loc;

            sky = new SkyBox();
            sky.Initialize(this.GraphicsDevice);

            textureList = new List<Texture2D>();
            modelList = new List<Model>();

            base.Initialize();
        }
示例#5
0
        public virtual void Draw(Matrix world, Matrix view, Matrix projection, Camera cam)
        {
            Matrix change = world* Matrix.CreateScale(this.Scale) * Matrix.CreateTranslation(this.Location)  * Matrix.CreateRotationY(cam.Rotation.Y);

            model.Draw(change , view, projection);
        }