Exemplo n.º 1
0
        private static void Graphics3DApplication_Initialize(Graphics3DDevice obj)
        {
            Viewport vp1 = ViewportManager.CreateViewport("main1", ViewportCreator.CreateViewport(
                                                              0, 0, Graphics3DSystem.Configuration.ScreenConfiguration.Width, Graphics3DSystem.Configuration.ScreenConfiguration.Height / 2, Color.Blue));

            vp1.Camera.ViewInformation.Position = new Vector3(2, 2, 2);
            Viewport vp2 = ViewportManager.CreateViewport("main2", ViewportCreator.CreateViewport(
                                                              0, Graphics3DSystem.Configuration.ScreenConfiguration.Height / 2, Graphics3DSystem.Configuration.ScreenConfiguration.Width, Graphics3DSystem.Configuration.ScreenConfiguration.Height / 2, Color.Red));

            vp2.Camera.ViewInformation.Position = new Vector3(2, 2, 0);

            Mesh   mesh   = MeshManager.CreateMesh("mesh1", MeshCreator.CreateBox(1, 1, 1));
            Entity entity = EntityManager.CreateEntity("entity1", EntityCreator.CreateObjectEntity(mesh));
            Light  light  = LightManager.CreateLight("light1", LightCreator.CreatePointLight(new Vector3(5, 5, 5), Color.White, Color.Red, Color.White, 8f));

            EntityNode node = obj.RootNode.AddEntityNode("node1", entity);
        }