Ejemplo n.º 1
0
        public int crearCubo3D(int tamanoCubo3D, int numeroOperaciones)
        {
            using (aspnet_MVC2_DCED3249_C6F3_4707_9B6F_1544191732C7Context context = new aspnet_MVC2_DCED3249_C6F3_4707_9B6F_1544191732C7Context())
            {
                try
                {
                    for (int i = 0; i < tamanoCubo3D; i++)
                    {
                        for (int j = 0; j < tamanoCubo3D; j++)
                        {
                            for (int z = 0; z < tamanoCubo3D; z++)
                            {
                                Cubo3D informacion = new Cubo3D();
                                informacion.X     = i;
                                informacion.Y     = j;
                                informacion.Z     = z;
                                informacion.Valor = 0;
                                var prueba = context.Cubo3D.Add(informacion);
                                context.SaveChanges();
                            }
                        }
                    }


                    var opc2 = context.Opciones.FirstOrDefault(x => x.Id == 1);
                    opc2.NumeroOperacionesM = numeroOperaciones;
                    opc2.TamanoMatrizN      = tamanoCubo3D;
                    context.SaveChanges();
                    return(0);
                }
                catch (Exception exp)
                {
                    string msg;
                    msg = exp.Message;
                    return(1);
                }
            }
            return(0);
        }
Ejemplo 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);

            // TODO: use this.Content to load your game content here
            cuadClick = new Cuadrado3DClick(GraphicsDevice, Content.Load<Texture2D>(@"Texture\TestSprite"));;
            cuadClick.ClickEvent = new Cuadrado3DClick.ClickEventHandler(ClickEventHandler);
            cuadClick.Scale = Matrix.CreateScale(0.4f);
            cuadClick.Position = new Vector3(0, 0, -4.99f);

            cubo = new Cubo3D(GraphicsDevice, ObtenerTexturasPorEscena(numeroEscena), false);
            cubo.Scale = Matrix.CreateScale(5);
        }