Exemple #1
0
        private static void SetCam(TextureTarget f, Cam3D 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;
            }
        }
Exemple #2
0
        private void DrawFace(int i)
        {
            TextureTarget 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();
        }