updates to matrix calculations

This commit is contained in:
Joakim Kilby
2015-02-19 15:40:08 +01:00
parent f87696f762
commit 26595edc90
3 changed files with 11 additions and 19 deletions
+2 -2
View File
@@ -162,8 +162,8 @@ void mainPostSyncPreDrawFunc()
void mainRenderFunc()
{
glm::mat4 userMatrix = glm::translate(glm::mat4(1.f), -_sgctEngine->getUserPtr()->getPos());
glm::mat4 viewMatrix = _sgctEngine->getActiveModelViewMatrix() * userMatrix;
glm::mat4 userMatrix = glm::translate(glm::mat4(1.f), _sgctEngine->getUserPtr()->getPos());
glm::mat4 viewMatrix = _sgctEngine->getActiveViewMatrix() * userMatrix;
glm::mat4 projectionMatrix = _sgctEngine->getActiveProjectionMatrix();
OsEng.render(projectionMatrix, viewMatrix);
}
+8 -16
View File
@@ -371,31 +371,23 @@ namespace openspace {
const glm::vec3 eyePosition
= sgct_core::ClusterManager::instance()->getUserPtr("")->getPos();
#else
//const glm::vec3 eyePosition
// = sgct_core::ClusterManager::instance()->getUserPtr()->getPos();
const glm::vec3 eyePosition
= sgct_core::ClusterManager::instance()->getUserPtr()->getPos();
#endif
//@CHECK does the dome disparity disappear if this line disappears? ---abock
//const glm::mat4 view
// = glm::translate(glm::mat4(1.0),
// eyePosition); // make sure the eye is in the center
//_mainCamera->setViewProjectionMatrix(
// sgct::Engine::instance()->getActiveModelViewProjectionMatrix() * view);
//
//_mainCamera->setModelMatrix(
// sgct::Engine::instance()->getModelMatrix());
_mainCamera->setViewMatrix(
viewMatrix );
//_mainCamera->setViewMatrix(
// sgct::Engine::instance()->getActiveViewMatrix()* view);
_mainCamera->setProjectionMatrix(
projectionMatrix);
//_mainCamera->setProjectionMatrix(
// sgct::Engine::instance()->getActiveProjectionMatrix());
_mainCamera->setViewMatrix(viewMatrix);
_mainCamera->setProjectionMatrix(projectionMatrix);
//is this really necessary?
//Is this really necessary to store?
_mainCamera->setViewProjectionMatrix(projectionMatrix * viewMatrix);
// render the scene starting from the root node
if (!_visualizeABuffer) {
+1 -1
View File
@@ -179,7 +179,7 @@ void RenderableStars::render(const RenderData& data) {
// is done twice? ---abock
glm::vec2 scaling = glm::vec2(1, -19);
glm::mat4 modelMatrix = data.camera.modelMatrix();
glm::mat4 modelMatrix = glm::mat4(1.0);
glm::mat4 viewMatrix = data.camera.viewMatrix();
glm::mat4 projectionMatrix = data.camera.projectionMatrix();