Ejemplo n.º 1
0
        protected override void CreateScene()
        {
            Entity camera = new Entity("MainCamera")
                            .AddComponent(new Camera3D()
            {
                Position        = Vector3.Up,
                LookAt          = Vector3.Forward,
                BackgroundColor = Color.White,
            })
                            .AddComponent(new CameraBehavior());

            EntityManager.Add(camera);


            var size = 500f;

            EntityManager.Add(EntitiesFactory.CreatePlane("plane1", new Vector3(0, -150, 0), new Vector3(size, 1f, size)));
            EntityManager.Add(EntitiesFactory.CreatePlane("plane2", new Vector3(0, 150, 0), new Vector3(size, 1f, size)));
            EntityManager.Add(EntitiesFactory.CreatePlane("plane3", new Vector3(-150, 0, 0), new Vector3(1f, size, size)));
            EntityManager.Add(EntitiesFactory.CreatePlane("plane4", new Vector3(150, 0, 0), new Vector3(1f, size, size)));
            EntityManager.Add(EntitiesFactory.CreatePlane("plane5", new Vector3(0, 0, -150), new Vector3(size, size, 1f)));
            EntityManager.Add(EntitiesFactory.CreatePlane("plane6", new Vector3(0, 0, 150), new Vector3(size, size, 1f)));

            for (int i = 0; i < 100; i++)
            {
                var ball1 = EntitiesFactory.CreateBall("ball" + i);
                EntityManager.Add(ball1);
            }
        }
Ejemplo n.º 2
0
        protected override void CreateScene()
        {
            this.Load(@"Content/Scenes/MyScene.wscene");

            for (int i = 0; i < 100; i++)
            {
                var ball1 = EntitiesFactory.CreateBall("ball" + i);
                EntityManager.Add(ball1);
            }
        }