Forum » Programiranje » [c++, OpenGL] View Frustum
[c++, OpenGL] View Frustum
goranv ::
Na tej strani ( https://cgvr.cs.uni-bremen.de/teaching/... ) si pomagam izracunati oddaljeno levo zgordnjo tocko in ne dobim pravi rezultat. Na koncu sem moral x pomnoziti z -1.0f da mi pravilno deluje, ampak y je previsok. farTL = x=-5.22808695 y=4.99525404 z=-10.0000000.
float farDinstance = 10.0f; Vec3 camPos( 0.0f, 0.0f, 0.0f ), camForward( 0.0f, 0.0f, -10.0f ); camForward.Normalize(); Vec3 farCenter = camPos + camForward * farDinstance, camUp( 0.0f, 1.0f, 0.0f ), a; float farH = 2 * tanf( DEG2RAD(54.0f) * 0.5f ) * farDinstance, farW = farH * ogl.GetRatio(); // ratio: 1.04569602 a = camUp; Vec3 camRight = a.CrossProduct( camForward ); camRight.Normalize(); Vec3 farTL = farCenter + (camUp * farH * 0.5f) - (camRight * farW * 0.5f); farTL.x *= -1.0f;
- spremenil: goranv ()
Vredno ogleda ...
Tema | Ogledi | Zadnje sporočilo | |
---|---|---|---|
Tema | Ogledi | Zadnje sporočilo | |
» | tekstura [c++ opengl]Oddelek: Programiranje | 911 (696) | matej94 |
» | DirectX - težavicaOddelek: Programiranje | 1262 (995) | Senitel |
» | [c++]OpenGL izris kvadrataOddelek: Programiranje | 1269 (1129) | Mavrik |
» | C++ programirane v Open GL oz. Direct xOddelek: Programiranje | 2975 (2246) | Vesoljc |
» | OpenGL problemOddelek: Programiranje | 2481 (2047) | Gundolf |