Beispiel #1
0
        public OpenGLVisualization(IEnumerable <IGraphicalBody> graphicalBodies, bool vr, params ILightSource[] lights) :
            base(1220, 720, new GraphicsMode(GraphicsMode.Default.ColorFormat, GraphicsMode.Default.Depth, GraphicsMode.Default.Stencil, NumFSAASamples, GraphicsMode.Default.AccumulatorFormat),
                 "LabBox Vis")
        {
            VRFlag = vr;
            if (VRFlag)
            {
                vrScene    = OpenVRScene.Create(NearClip, FarClip);
                Input      = vrScene.OpenVRInput;
                vrDrawable = new BasicDrawable((vpMat, camPos) => RenderVR(vpMat, camPos));
            }
            else
            {
                Input = new OpenGLInputObservable(this);
            }

            // not sure how we should handle the ICamera interface in VR yet
            var cam = new FreeCamera(Input);

            cam.MaxRange = FarClip;
            cam.MinRange = NearClip;
            toDispose.Add(cam);
            Camera = cam;

            bodies       = graphicalBodies.ToList();
            lightSources = lights.ToList();

            BindEvents();
        }
Beispiel #2
0
        public HelloVRWindow(string windowTitle) : base(1280, 720, GraphicsMode.Default, windowTitle, GameWindowFlags.Default)
        {
            scene = OpenVRScene.Create(0.1f, 20.0f);

            Load        += HelloVRWindow_Load;
            UpdateFrame += HelloVRWindow_UpdateFrame;
            RenderFrame += HelloVRWindow_RenderFrame;
        }