Пример #1
0
 public void Draw(GameTime gametime, Camera camera)
 {
     wings.Draw(gametime, camera);
     body.Draw(gametime, camera);
     tail.Draw(gametime, camera);
     c.Draw(gametime, camera);
 }
Пример #2
0
 public void Draw(GameTime gt, Camera camera)
 {
     Matrix baseworld = Transformation;
     foreach (ModelMesh mesh in Model.Meshes)
     {
         Matrix localworld = modeltransforms[mesh.ParentBone.Index] * baseworld;
         foreach (ModelMeshPart meshpart in mesh.MeshParts)
         {
             Effect effect = meshpart.Effect;
             if (effect is BasicEffect)
             {
                 ((BasicEffect)effect).World = localworld;
                 ((BasicEffect)effect).View = camera.View;
                 ((BasicEffect)effect).Projection = camera.Projection;
                 ((BasicEffect)effect).EnableDefaultLighting();
                 if (Texture2D != null)
                 {
                     ((BasicEffect)effect).Texture = Texture2D;
                 }
             }
             else
             {
                 setEffectParameter(effect, "World", localworld);
                 setEffectParameter(effect, "View", camera.View);
                 setEffectParameter(effect, "Projection", camera.Projection);
             }
         }
         mesh.Draw();
     }
 }
Пример #3
0
 protected override void Initialize()
 {
     spriteBatch = new SpriteBatch(GraphicsDevice);
     cam = new TargetCamera(new Vector3(0, 0, 100), Vector3.Zero, GraphicsDevice);
     sph = new Sphere(new Vector3(30, 0, 0), 10, Color.Violet, GraphicsDevice);
     sph2 = new Sphere(new Vector3(-30, 0, 0), 10, Color.LightGreen, GraphicsDevice);
     drawables.Add(sph);
     drawables.Add(sph2);
 }
Пример #4
0
 public void Draw(GameTime gametime, Camera camera)
 {
     effect.World = Matrix.CreateTranslation(Position) * transfomation;
     effect.View = camera.View;
     effect.Projection = camera.Projection;
     foreach (EffectPass pass in effect.CurrentTechnique.Passes)
     {
         pass.Apply();
         graphicd.DrawUserIndexedPrimitives<VertexPositionColor>(PrimitiveType.TriangleList, vertices, 0, nvertices, indices, 0, indices.Length / 3);
     }
 }
Пример #5
0
 public void Draw(GameTime gametime, Camera camera)
 {
     effect.View = camera.View;
     effect.World = Matrix.Identity;
     effect.Projection = camera.Projection;
     foreach (EffectPass pass in effect.CurrentTechnique.Passes)
     {
         pass.Apply();
         graphics.DrawUserIndexedPrimitives<VertexPositionNormalTexture>(PrimitiveType.TriangleList, vertices, 0, nvertices, indices, 0, indices.Length / 3);
     }
 }
Пример #6
0
 public void Draw(GameTime gametime, Camera cam)
 {
     effect.Projection = cam.Projection;
     effect.View = cam.View;
     effect.World = Matrix.CreateScale(scale) * Matrix.CreateTranslation(Position) * Transformation;
     foreach (EffectPass pass in effect.CurrentTechnique.Passes)
     {
         pass.Apply();
         Graphics.DrawUserPrimitives<VertexPositionColor>(PrimitiveType.TriangleList, cube, 0, 6);
     }
 }
Пример #7
0
 public void Draw(GameTime gt, Camera cam)
 {
     cube.Draw(gt, cam);
 }
Пример #8
0
 public void Draw(GameTime gametime, Camera camera)
 {
     sphere.Draw(gametime, camera);
 }