コード例 #1
0
ファイル: VLight.cs プロジェクト: VividMaster/Rebound
        private static void SetCam(TextureTarget f, GraphCam3D Cam)
        {
            switch (f)
            {
            case TextureTarget.TextureCubeMapPositiveX:
                Cam.LookAtZero(new Vector3(1, 0, 0), new Vector3(0, -1, 0));
                break;

            case TextureTarget.TextureCubeMapNegativeX:
                Cam.LookAtZero(new Vector3(-1, 0, 0), new Vector3(0, -1, 0));
                break;

            case TextureTarget.TextureCubeMapPositiveY:
                Cam.LookAtZero(new Vector3(0, 1, 0), new Vector3(0, 0, 1));
                break;

            case TextureTarget.TextureCubeMapNegativeY:
                Cam.LookAtZero(new Vector3(0, -1, 0), new Vector3(0, 0, -1));
                break;

            case TextureTarget.TextureCubeMapPositiveZ:
                Cam.LookAtZero(new Vector3(0, 0, 1), new Vector3(0, -1, 0));
                break;

            case TextureTarget.TextureCubeMapNegativeZ:
                Cam.LookAtZero(new Vector3(0, 0, -1), new Vector3(0, -1, 0));
                break;
            }
        }
コード例 #2
0
        private void DrawFace(int i)
        {
            var face = FB.SetFace(i);

            GL.Clear(ClearBufferMask.ColorBufferBit | ClearBufferMask.DepthBufferBit);
            switch (face)
            {
            case TextureTarget.TextureCubeMapPositiveX:
                Cam.LookAtZero(new Vector3(1, 0, 0), new Vector3(0, 1, 0));
                break;

            case TextureTarget.TextureCubeMapNegativeX:
                Cam.LookAtZero(new Vector3(-1, 0, 0), new Vector3(0, 1, 0));
                break;

            case TextureTarget.TextureCubeMapPositiveY:
                Cam.LookAtZero(new Vector3(0, 10, 0), new Vector3(1, 0, 0));
                break;

            case TextureTarget.TextureCubeMapNegativeY:
                Cam.LookAtZero(new Vector3(0, -10, 0), new Vector3(1, 0, 0));
                break;

            case TextureTarget.TextureCubeMapPositiveZ:
                Cam.LookAtZero(new Vector3(0, 0, 10), new Vector3(0, 1, 0));
                break;

            case TextureTarget.TextureCubeMapNegativeZ:
                Cam.LookAtZero(new Vector3(0, 0, -10), new Vector3(0, 1, 0));
                break;
            }
            Scene.CamOverride = Cam;
            Scene.Render();
            Scene.CamOverride = null;
            FB.Release();
        }