Esempio n. 1
0
 public static PerspectiveViewport CreatePerspectiveViewport(ViewportPanel viewportControl)
 {
     PerspectiveViewport controller = new PerspectiveViewport();
     RegisterViewportController(controller, viewportControl);
     return controller;
 }
Esempio n. 2
0
        private static IViewportController RegisterViewportController(IViewportController controller, ViewportPanel control)
        {
            control.Initialise(controller);

            // first viewport
            if (viewportControllers.Count == 0)
            {
                ResourceGroupManager.Singleton.InitialiseAllResourceGroups();

                // lighting
                Engine.Graphics.SceneManager.ShadowTechnique = ShadowTechnique.SHADOWTYPE_STENCIL_MODULATIVE;
                Engine.Graphics.SceneManager.AmbientLight = new ColourValue(0.85f, 0.85f, 0.85f);
                Engine.Graphics.SceneManager.ShadowColour = new ColourValue(0.75f, 0.75f, 0.75f);

                // default light
                Light light = Engine.Graphics.SceneManager.CreateLight("defaultLight");
                light.DiffuseColour = ColourValue.White;
                light.SpecularColour = ColourValue.White;
                light.Direction = new Vector3(0.2f, -1.0f, 0.2f);
                light.Type = Light.LightTypes.LT_DIRECTIONAL;

                if (OnCreateViewportController != null)
                    OnCreateViewportController(controller, EventArgs.Empty);
            }

            controller.SizeChanged();
            controller.CreateScene();

            viewportControllers.Add(controller);
            return controller;
        }
Esempio n. 3
0
 public static OrthographicViewport CreateOrthographicViewport(ViewportPanel viewportControl, Vector3 axis)
 {
     OrthographicViewport controller = new OrthographicViewport(axis);
     RegisterViewportController(controller, viewportControl);
     return controller;
 }