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 | 905 (690) | matej94 |
» | DirectX - težavicaOddelek: Programiranje | 1255 (988) | Senitel |
» | [c++]OpenGL izris kvadrataOddelek: Programiranje | 1267 (1127) | Mavrik |
» | C++ programirane v Open GL oz. Direct xOddelek: Programiranje | 2966 (2237) | Vesoljc |
» | OpenGL problemOddelek: Programiranje | 2475 (2041) | Gundolf |