public virtual void Update(GameTime gameTime, Camera camera) { }
public Effect GetEffectToUse(Camera camera) { if (!IsTransitionAnimationInProgress) { basicEffect.World = GetWorld(); basicEffect.View = camera.View; basicEffect.Projection = camera.Projection; //basicEffect.VertexColorEnabled = true; basicEffect.Texture = texture; basicEffect.TextureEnabled = true; return basicEffect; } else { TAEffect.Parameters["World"].SetValue(GetWorld()); TAEffect.Parameters["View"].SetValue(camera.View); TAEffect.Parameters["Projection"].SetValue(camera.Projection); TAEffect.Parameters["TextureOrigin"].SetValue(texture); TAEffect.Parameters["TextureDestiny"].SetValue(destinyTexture); TAEffect.Parameters["AlphaPercentaje"].SetValue(animationProgress); return TAEffect; } }
public virtual void Draw(Camera camera) { if (visible) { foreach (Cuadrado3D cuadrado in faces) { cuadrado.Draw(camera); } /*foreach (GoTo cuadrado in listaGoTo) { cuadrado.Draw(camera); } foreach (HotSpot cuadrdo in listaHotSpot) { cuadrdo.Draw(camera); }*/ } }
public virtual void Draw(Camera camera) { if (visible) { foreach (EffectPass pass in GetEffectToUse(camera).CurrentTechnique.Passes) { pass.Apply(); graphicsDevice.BlendState = BlendState.AlphaBlend; //graphicsDevice.DrawUserPrimitives<VertexPositionTexture>(PrimitiveType.TriangleStrip, verts, 0, 2); graphicsDevice.DrawUserPrimitives<VertexPositionTexture>(PrimitiveType.TriangleStrip, verts, 0, 2); graphicsDevice.BlendState = BlendState.Opaque; } } }
/// <summary> /// LoadContent will be called once per game and is the place to load /// all of your content. /// </summary> protected override void LoadContent() { // Create a new SpriteBatch, which can be used to draw textures. spriteBatch = new SpriteBatch(GraphicsDevice); Texture2D[] listaTexturas = new Texture2D[4]; listaTexturas[0] = Content.Load<Texture2D>(@"AssetsTest\paseoVirtual01\east01"); listaTexturas[1] = Content.Load<Texture2D>(@"AssetsTest\paseoVirtual01\north01"); listaTexturas[2] = Content.Load<Texture2D>(@"AssetsTest\paseoVirtual01\south01"); listaTexturas[3] = Content.Load<Texture2D>(@"AssetsTest\paseoVirtual01\west01"); space = new HotSpace(this.GraphicsDevice, "Pruebas", listaTexturas, false); cuad = new Cuadrado3D(GraphicsDevice, Content.Load<Texture2D>(@"AssetsTest\paseoVirtual01\east01")); cuad.Position = new Vector3(0.0f, 0.0f, -1.0f); cam = new Camera(this, Vector3.Zero, new Vector3(0, 0, -1), Vector3.Up); Components.Add(cam); // TODO: use this.Content to load your game content here }