Scenery3d.cpp   Scenery3d.cpp 
skipping to change at line 1652 skipping to change at line 1652
//this call modifies projection + mv matrices, so we have to set them afterwards //this call modifies projection + mv matrices, so we have to set them afterwards
if(!renderShadowMaps()) if(!renderShadowMaps())
return; //shadow map rendering failed, do an early abort return; //shadow map rendering failed, do an early abort
} }
mvMatrix.translate(absolutePosition.v[0],absolutePosition.v[1],absolute Position.v[2]); mvMatrix.translate(absolutePosition.v[0],absolutePosition.v[1],absolute Position.v[2]);
//set final rendering matrices //set final rendering matrices
modelViewMatrix = mvMatrix; modelViewMatrix = mvMatrix;
projectionMatrix.setToIdentity(); projectionMatrix.setToIdentity();
projectionMatrix.perspective(fov,aspect,currentScene.camNearZ,currentSc
ene.camFarZ); //without viewport offset, you could simply call this:
//projectionMatrix.perspective(fov,aspect,currentScene.camNearZ,current
Scene.camFarZ);
//these 2 lines replicate gluPerspective with glFrustum
float fH = qTan( fov / 360.0f * M_PI ) * currentScene.camNearZ;
float fW = fH * aspect;
//apply offset values
Vec2f vp = altAzProjector->getViewportCenterOffset();
float horizOffset = 2.0 * fW * vp[0];
float vertOffset = - 2.0 * fH * vp[1];
//final projection matrix
projectionMatrix.frustum(-fW + horizOffset, fW + horizOffset,
-fH + vertOffset, fH + vertOffset,
currentScene.camNearZ, currentScene.camFarZ);
//depth test needs enabling, clear depth buffer, color buffer already c ontains background so it stays //depth test needs enabling, clear depth buffer, color buffer already c ontains background so it stays
glEnable(GL_DEPTH_TEST); glEnable(GL_DEPTH_TEST);
//glDepthFunc(GL_LEQUAL); //glDepthFunc(GL_LEQUAL);
glDepthMask(GL_TRUE); glDepthMask(GL_TRUE);
glClear(GL_DEPTH_BUFFER_BIT); glClear(GL_DEPTH_BUFFER_BIT);
//enable backface culling for increased performance //enable backface culling for increased performance
glEnable(GL_CULL_FACE); glEnable(GL_CULL_FACE);
 End of changes. 1 change blocks. 
2 lines changed or deleted 17 lines changed or added

This html diff was produced by rfcdiff 1.41. The latest version is available from http://tools.ietf.org/tools/rfcdiff/