Bonjour à tous,
- Est-ce vous pouvez me dire comment utiliser la fonction glFrustumf ? J'ai essayé comme ci-dessous mais il ne marche pas, je ne vois rien sur l'écran.
l'utilisation:
Code : Sélectionner tout - Visualiser dans une fenêtre à part gluPerspective(60.0f, float(iScreenWidth)/float(iScreenHeight), 3.f, 100.f);
la définition:
- Comment mettre ma scène au center de l’écran ?
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 void CUFPPLayerAppView::gluPerspective(TReal32 fovy, TReal32 aspect, TReal32 zNear, TReal32 zFar) { TReal32 xmin, xmax, ymin, ymax; TReal res, tmp; tmp = (TReal)(fovy * 0.0087266462599716478846111111111111f); // 3,14159265358979323846 / 360.0 Math::Tan(res,tmp); ymax = (TReal32)(res) * zNear; ymin = -ymax; xmin = ymin * aspect; xmax = ymax * aspect; glFrustumf(xmin, xmax, ymin, ymax, zNear, zFar); }
Merci
Partager