mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-04-25 21:48:57 -05:00
updates to matrix calculations
This commit is contained in:
+2
-2
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user