Reduced FOV in kart preview rendering so that they look more natural (less 'stretched')
git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/branches/irrlicht@3949 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
parent
ff2dd24ec6
commit
1281cc5cfd
@ -643,7 +643,10 @@ IrrDriver::RTTProvider::~RTTProvider()
|
|||||||
tearDownRTTScene();
|
tearDownRTTScene();
|
||||||
}
|
}
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
/** Sets up a given vector of meshes for render-to-texture. Parameters:
|
/** Sets up a given vector of meshes for render-to-texture. Ideal to embed a 3D
|
||||||
|
* object insdie the GUI.
|
||||||
|
*
|
||||||
|
* Parameters:
|
||||||
* \param mesh Vector of meshes to render.
|
* \param mesh Vector of meshes to render.
|
||||||
* \param mesh_location For each mesh the location where it should be
|
* \param mesh_location For each mesh the location where it should be
|
||||||
* positioned.
|
* positioned.
|
||||||
@ -671,7 +674,7 @@ void IrrDriver::RTTProvider::setupRTTScene(ptr_vector<scene::IMesh, REF>& mesh,
|
|||||||
node->updateAbsolutePosition();
|
node->updateAbsolutePosition();
|
||||||
}
|
}
|
||||||
|
|
||||||
m_rtt_main_node->setScale( core::vector3df(50.0f, 50.0f, 50.0f) );
|
m_rtt_main_node->setScale( core::vector3df(35.0f, 35.0f, 35.0f) );
|
||||||
|
|
||||||
//vector3d< f32 > modelsize = mesh->getBoundingBox().getExtent();
|
//vector3d< f32 > modelsize = mesh->getBoundingBox().getExtent();
|
||||||
//std::cout << "box size " << modelsize.X*50.0 << ", " << modelsize.Y*50.0 << ", " << modelsize.Z*50.0 << std::endl;
|
//std::cout << "box size " << modelsize.X*50.0 << ", " << modelsize.Y*50.0 << ", " << modelsize.Z*50.0 << std::endl;
|
||||||
@ -695,20 +698,20 @@ void IrrDriver::RTTProvider::setupRTTScene(ptr_vector<scene::IMesh, REF>& mesh,
|
|||||||
{
|
{
|
||||||
m_rtt_main_node->getMaterial(n).setFlag(EMF_LIGHTING, true);
|
m_rtt_main_node->getMaterial(n).setFlag(EMF_LIGHTING, true);
|
||||||
|
|
||||||
m_rtt_main_node->getMaterial(n).Shininess = 200.0f; // set size of specular highlights
|
m_rtt_main_node->getMaterial(n).Shininess = 100.0f; // set size of specular highlights
|
||||||
m_rtt_main_node->getMaterial(n).SpecularColor.set(255,150,150,150);
|
m_rtt_main_node->getMaterial(n).SpecularColor.set(255,50,50,50);
|
||||||
m_rtt_main_node->getMaterial(n).DiffuseColor.set(255,150,150,150);
|
m_rtt_main_node->getMaterial(n).DiffuseColor.set(255,150,150,150);
|
||||||
|
|
||||||
//node->getMaterial(n).setFlag(EMF_NORMALIZE_NORMALS , true);
|
//node->getMaterial(n).setFlag(EMF_NORMALIZE_NORMALS , true);
|
||||||
m_rtt_main_node->getMaterial(n).setFlag(EMF_GOURAUD_SHADING , true);
|
m_rtt_main_node->getMaterial(n).setFlag(EMF_GOURAUD_SHADING , true);
|
||||||
m_rtt_main_node->getMaterial(n).GouraudShading = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
m_camera = irr_driver->getSceneManager()->addCameraSceneNode();
|
m_camera = irr_driver->getSceneManager()->addCameraSceneNode();
|
||||||
|
|
||||||
m_camera->setPosition( core::vector3df(0.0, 30.0f, 70.0f) );
|
m_camera->setPosition( core::vector3df(0.0, 20.0f, 70.0f) );
|
||||||
m_camera->setUpVector( core::vector3df(0.0, 1.0, 0.0) );
|
m_camera->setUpVector( core::vector3df(0.0, 1.0, 0.0) );
|
||||||
m_camera->setTarget( core::vector3df(0, 10, 0.0f) );
|
m_camera->setTarget( core::vector3df(0, 10, 0.0f) );
|
||||||
|
m_camera->setFOV( DEGREE_TO_RAD*50.0f );
|
||||||
m_camera->updateAbsolutePosition();
|
m_camera->updateAbsolutePosition();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -88,7 +88,7 @@ void ModelViewWidget::addModel(irr::scene::IMesh* mesh, const Vec3& location)
|
|||||||
// -----------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------
|
||||||
void ModelViewWidget::update(float delta)
|
void ModelViewWidget::update(float delta)
|
||||||
{
|
{
|
||||||
angle += delta*25;
|
angle += delta*35;
|
||||||
if (angle > 360) angle -= 360;
|
if (angle > 360) angle -= 360;
|
||||||
|
|
||||||
if (m_rtt_provider == NULL)
|
if (m_rtt_provider == NULL)
|
||||||
|
Loading…
Reference in New Issue
Block a user