Exemplo n.º 1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="HotSpace"/> class.
        /// </summary>
        /// <param name="graphicsDevice">The graphics device.</param>
        /// <param name="listTextures">Lista de Texture2D correspondiente al frontal, derecha, atras, izquierda, arriba y abajo
        /// respectivamente. </param>
        public HotSpace(GraphicsDevice graphicsDevice, String name, Texture2D[] listTextures, bool ext)
        {
            this.graphicsDevice = graphicsDevice;
            this.name = name;

            //inicializar lista de hotspots
            //listaHotSpot = new List<HotSpot>();

            //inicializar lista de gotos
            //listaGoTo = new List<GoTo>();

            //Inicializar caras del hot space

            faces = new Cuadrado3D[4];
            faces[0] = new Cuadrado3D(graphicsDevice, listTextures[0]);
            faces[1] = new Cuadrado3D(graphicsDevice, listTextures[1]);
            faces[2] = new Cuadrado3D(graphicsDevice, listTextures[2]);
            faces[3] = new Cuadrado3D(graphicsDevice, listTextures[3]);
            //faces[4] = new Cuadrado3D(listTextures[4]);
            //faces[5] = new Cuadrado3D(listTextures[5]);

            if (ext) faces[0].Rotation = Matrix.CreateRotationY(MathHelper.Pi);
            faces[0].Position = new Vector3(0.0f, 0.0f, -1.0f);

            if (ext) faces[1].Rotation = Matrix.CreateRotationY(MathHelper.PiOver2);
            else faces[1].Rotation = Matrix.CreateRotationY(-MathHelper.PiOver2);
            faces[1].Position = new Vector3(1.0f, 0.0f, 0.0f);

            if (!ext) faces[2].Rotation = Matrix.CreateRotationY(MathHelper.Pi);
            faces[2].Position = new Vector3(0.0f, 0.0f, 1.0f);

            if (ext) faces[3].Rotation = Matrix.CreateRotationY(-MathHelper.PiOver2);
            else faces[3].Rotation = Matrix.CreateRotationY(MathHelper.PiOver2);
            faces[3].Position = new Vector3(-1.0f, 0.0f, 0.0f);

            /*if (ext) faces[4].Rotation = Matrix.CreateRotationX(-MathHelper.PiOver2);
            else faces[4].Rotation = Matrix.CreateRotationX(MathHelper.PiOver2);
            faces[4].Position = new Vector3(0.0f, 1.0f, 0.0f);

            if (ext) faces[5].Rotation = Matrix.CreateRotationX(MathHelper.PiOver2);
            else faces[5].Rotation = Matrix.CreateRotationX(-MathHelper.PiOver2);
            faces[5].Position = new Vector3(0.0f, -1.0f, 0.0f);*/

            effect = new BasicEffect(graphicsDevice);
        }
Exemplo n.º 2
0
        /// <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
        }