Exemplo n.º 1
0
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);

            GL.ClearColor(0, 0, 0, 0);
            GL.Enable(EnableCap.DepthTest);
            GL.Enable(EnableCap.Texture2D);
            GL.Hint(HintTarget.PerspectiveCorrectionHint, HintMode.Nicest);
            GL.Enable(EnableCap.CullFace);
            GL.ShadeModel(ShadingModel.Smooth);
            GL.Enable(EnableCap.Lighting);
            GL.Enable(EnableCap.Light0);

            Util.Set3DMode();

            skydome.LoadSkydome("sky/space.jpg", 1f);
            world.Add(skydome); // skydome aina ekana koska se on kaikkien takana

            const float Scale = 100;
            city = new ObjModel("city", "city.obj", Scale, Scale, Scale);
            world.Add(city);

            // lataa reitit
            cameraPath = new Path("path", "camerapath.obj", Scale, Scale, Scale); // sama skaalaus ku cityssä

            cameraPath.MakeCurve(3); // tehdään reitistä spline
            cameraPath.FollowPath(cam, true, true);
        }