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 | 1263 (996) | Senitel |
» | [c++]OpenGL izris kvadrataOddelek: Programiranje | 1271 (1131) | Mavrik |
» | C++ programirane v Open GL oz. Direct xOddelek: Programiranje | 2977 (2248) | Vesoljc |
» | OpenGL problemOddelek: Programiranje | 2483 (2049) | Gundolf |