Exemplo n.º 1
0
// this is actually render
void updateSky()
{
	CMatrix skyCameraMatrix;
	skyCameraMatrix.identity();
	// 
	skyCameraMatrix= Camera.getMatrix();
	skyCameraMatrix.setPos(CVector::Null);
	SkyCamera.setMatrix(skyCameraMatrix);

	SkyScene->render();
	// Must clear ZBuffer For incoming rendering.
	Driver->clearZBuffer();

	if (!StereoHMD) // Cloudscape not supported (fix Viewport please)
		Clouds->render();
}
Exemplo n.º 2
0
void updateCamera()
{
	if (StereoHMD)
	{
		NLMISC::CQuat hmdOrient = StereoHMD->getOrientation();
		NLMISC::CMatrix camMatrix = Camera.getMatrix();
		NLMISC::CMatrix hmdMatrix;
		hmdMatrix.setRot(hmdOrient);
		NLMISC::CMatrix posMatrix; // minimal head modeling, will be changed in the future
		posMatrix.translate(StereoHMD->getEyePosition());
		Camera.setMatrix((camMatrix * hmdMatrix) * posMatrix);
	}
	// Set the new position of the snow emitter
	CMatrix	mat = CMatrix::Identity;
	mat.setPos (Camera.getMatrix().getPos()/*+CVector (0.0f, 0.0f, -10.0f)*/);
	Snow.setMatrix(mat);
}