コード例 #1
0
ファイル: Game1.cs プロジェクト: jt222ic/game_lab1
 public Game1()
 {
     graphics = new GraphicsDeviceManager(this);
     Content.RootDirectory = "Content";
        graphics.PreferredBackBufferWidth = 320;    // windows width
        graphics.PreferredBackBufferHeight = 240;   // windwos height
     camera = new Camera(graphics.PreferredBackBufferWidth, graphics.PreferredBackBufferHeight,8,8);  // 8 brickcs scaling to fit on screen if lower the other will get outside screen
 }
コード例 #2
0
ファイル: Game1.cs プロジェクト: ao222qc/1DV437_Assignments
 public Game1()
 {
     graphics = new GraphicsDeviceManager(this);
     camera = new Camera(graphics);
     Content.RootDirectory = "Content";
     Window.AllowUserResizing = true;
     graphics.PreferredBackBufferHeight = 620;
     graphics.PreferredBackBufferWidth = 480;
 }
コード例 #3
0
ファイル: Game1.cs プロジェクト: ks222rt/1DV437
        public chessBoard()
        {
            graphics = new GraphicsDeviceManager(this);
            Content.RootDirectory = "Content";
            graphics.IsFullScreen = false;
            graphics.PreferredBackBufferHeight = 320;
            graphics.PreferredBackBufferWidth = 240;
            graphics.ApplyChanges();

            camera = new Camera(graphics);
        }
コード例 #4
0
ファイル: tank.cs プロジェクト: 11614765/game_week9
        public Tank(Model model, GraphicsDevice device, Camera camera)
            : base(model)
        {
            mousePick = new MousePick(device, camera);
            turretBone = model.Bones["turret_geo"];
            wheels = new ModelBone[4];
            wheels[0] = model.Bones["r_front_wheel_geo"];
            wheels[1] = model.Bones["r_back_wheel_geo"];
            wheels[2] = model.Bones["l_front_wheel_geo"];
            wheels[3] = model.Bones["l_back_wheel_geo"];

            speed = 10f;
        }
コード例 #5
0
ファイル: Game1.cs プロジェクト: 11614765/game_week9
        /// <summary>
        /// Allows the game to perform any initialization it needs to before starting to run.
        /// This is where it can query for any required services and load any non-graphic
        /// related content.  Calling base.Initialize will enumerate through any components
        /// and initialize them as well.
        /// </summary>
        protected override void Initialize()
        {
            // TODO: Add your initialization logic here
            device = graphics.GraphicsDevice;
            modelManager = new ModelManager(this);
            Components.Add(modelManager);

            camera = new Camera(this,new Vector3(0,400 ,500), new Vector3(0,25,0), Vector3.Up);
            this.IsMouseVisible = true;
            Components.Add(camera);

            primitive = new Primitive(this, camera,device);
            Components.Add(primitive);

            base.Initialize();
        }
コード例 #6
0
ファイル: basicModel.cs プロジェクト: 11614765/game_week9
        public virtual void Draw(GraphicsDevice device, Camera camera)
        {
            Matrix[] transforms = new Matrix[model.Bones.Count];

            model.CopyAbsoluteBoneTransformsTo(transforms);

            foreach (ModelMesh mesh in model.Meshes)
            {
                foreach (BasicEffect effect in mesh.Effects)
                {

                    effect.View = camera.view;
                    effect.Projection = camera.projection;
                    effect.TextureEnabled = true;
                    effect.Alpha = 1;

                    //effect.World = mesh.ParentBone.Transform*Getworld();
                    effect.World = transforms[mesh.ParentBone.Index] * Getworld();

                }
                mesh.Draw();
            }
        }
コード例 #7
0
ファイル: MousePick.cs プロジェクト: 11614765/game_week9
 public MousePick(GraphicsDevice device, Camera camera)
 {
     this.device = device;
     this.camera = camera;
 }
コード例 #8
0
ファイル: tank.cs プロジェクト: 11614765/game_week9
 public override void Draw(GraphicsDevice device, Camera camera)
 {
     base.Draw(device, camera);
 }
コード例 #9
0
ファイル: primitive.cs プロジェクト: 11614765/game_week9
 public Primitive(Game game, Camera camera, GraphicsDevice device)
     : base(game)
 {
     this.camera = camera;
     pick = new MousePick(device, camera);
 }
コード例 #10
0
ファイル: Ground.cs プロジェクト: 11614765/game_week9
 public override void Draw(GraphicsDevice device, Camera camera)
 {
     device.SamplerStates[0] = SamplerState.LinearWrap;
     base.Draw(device, camera);
 }
コード例 #11
0
ファイル: Game1.cs プロジェクト: HeatherXi/QiXi-
        /// <summary>
        /// Allows the game to perform any initialization it needs to before starting to run.
        /// This is where it can query for any required services and load any non-graphic
        /// related content.  Calling base.Initialize will enumerate through any components
        /// and initialize them as well.
        /// </summary>
        protected override void Initialize()
        {
            // TODO: Add your initialization logic here

            camera = new Camera(this, new Vector3(0, 0, 5), Vector3.Zero,new Vector3(0,1,0));
            Components.Add(camera);
            rotation = Matrix.Identity;
               translation = Matrix.Identity;
               scale = Matrix.Identity;
            base.Initialize();
        }
コード例 #12
0
ファイル: SkyBox.cs プロジェクト: 11614765/game_week9
 public override void Draw(GraphicsDevice device, Camera camera)
 {
     skyBox = scale * Matrix.CreateTranslation((camera.cameraPosition) - new Vector3 (0,camera.cameraPosition.Y,0));
     device.SamplerStates[0] = SamplerState.LinearClamp;
     base.Draw(device, camera);
 }