mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-02-16 17:29:20 -06:00
Fixed model oriantation
After 32 maya exports and about 600 different attempts of different rotations / scalings along each axis I realised that the model is in fact correctly aligned and that what we are seing are precisional errors with the stupid boresight-polygon-baton. Nevertheless, out of all of those Im keeping some of the more cruicial test-objects (8 to be precise) for future reference, these can be deleted at some point, I just really want to keep them for now, comfort blanket.
This commit is contained in:
Submodule openspace-data updated: 8607807557...918a182699
@@ -1,10 +1,10 @@
|
||||
--openspace.setPropertyValue('Earth.renderable.colorTexture', '${OPENSPACE_DATA}/modules/mars/textures/mars.png')
|
||||
--openspace.time.setTime("2006-02-26T17:00:00")
|
||||
openspace.time.setTime("2006-08-22T20:00:00")
|
||||
openspace.time.setTime("2007-02-26T17:41:00")
|
||||
--openspace.time.setTime("2006-08-22T20:00:00")
|
||||
|
||||
--openspace.time.setDeltaTime(200000.0)
|
||||
--openspace.time.setDeltaTime(5000.00)
|
||||
openspace.time.setDeltaTime(10)
|
||||
openspace.time.setDeltaTime(1000)
|
||||
--openspace.time.setDeltaTime(30000.0)
|
||||
-- print(openspace.time.currentTimeUTC())
|
||||
|
||||
|
||||
@@ -40,13 +40,13 @@ void main()
|
||||
//diffuse = vec4(depth*5,0.0, 0.0, 1.0);
|
||||
//diffuse = vec4(vs_position.w,0.0, 0.0, 1.0);
|
||||
|
||||
vec4 diffuse = vec4(1,0,0,1);
|
||||
if( floor(vs_st[0]) == -2){
|
||||
vec4 diffuse = vec4(0.4,0.4,0.4,1);
|
||||
/*if( floor(vs_st[0]) == -2){
|
||||
diffuse = gridColor*2.f;
|
||||
}else{
|
||||
diffuse = gridColor;
|
||||
}
|
||||
diffuse = gridColor;
|
||||
}*/
|
||||
diffuse = gridColor;
|
||||
|
||||
|
||||
vec4 position = vs_position;
|
||||
|
||||
@@ -171,8 +171,8 @@ bool RenderableTrail::initialize(){
|
||||
completeSuccess &= (_texture != nullptr);
|
||||
|
||||
_startTrail;
|
||||
SpiceManager::ref().getETfromDate("2006 Aug 22 17:00:00", _startTrail);
|
||||
//SpiceManager::ref().getETfromDate("2007 feb 26 17:00:00", _startTrail);
|
||||
// SpiceManager::ref().getETfromDate("2006 Aug 22 17:00:00", _startTrail);
|
||||
SpiceManager::ref().getETfromDate("2007 feb 26 17:41:00", _startTrail);
|
||||
_dtEt = _startTrail;
|
||||
|
||||
fullYearSweep();
|
||||
|
||||
@@ -331,11 +331,13 @@ void RenderableWavefrontObject::render(const RenderData& data)
|
||||
|
||||
// scale the planet to appropriate size since the planet is a unit sphere
|
||||
glm::mat4 transform = glm::mat4(1);
|
||||
glm::mat4 scaler = glm::scale(transform, glm::vec3(0, 0, -1));
|
||||
glm::mat4 scale_n_z = glm::scale(transform, glm::vec3(1, 1, -1));
|
||||
|
||||
//earth needs to be rotated for that to work.
|
||||
glm::mat4 rot_x = glm::rotate(transform, 270.f, glm::vec3(1, 0, 0));
|
||||
glm::mat4 rot_y = glm::rotate(transform, 90.f, glm::vec3(0, 1, 0));
|
||||
glm::mat4 rot_x = glm::rotate(transform, 180.f, glm::vec3(1, 0, 0));
|
||||
glm::mat4 rot_n_x = glm::rotate(transform, 90.f, glm::vec3(-1, 0, 0));
|
||||
|
||||
glm::mat4 rot_y = glm::rotate(transform, 90.f, glm::vec3(0, -1, 0));
|
||||
|
||||
|
||||
glm::mat4 tmp = glm::mat4(1);
|
||||
@@ -344,17 +346,27 @@ void RenderableWavefrontObject::render(const RenderData& data)
|
||||
tmp[i][j] = _stateMatrix[i][j];
|
||||
}
|
||||
}
|
||||
//transform *= tmp;
|
||||
|
||||
transform *= tmp;
|
||||
//transform *= scale_n_z;
|
||||
//transform *= rot_x;
|
||||
//transform *= scale_n_z;
|
||||
|
||||
|
||||
|
||||
//transform *= rot_x;
|
||||
//transform *= rot_y;
|
||||
|
||||
glm::mat4 modelview = data.camera.viewMatrix()*data.camera.modelMatrix();
|
||||
glm::vec4 camSpaceEye = -(modelview*currentPosition.vec4());
|
||||
// setup the data to the shader
|
||||
// _programObject->setUniform("camdir", camSpaceEye);
|
||||
|
||||
psc tmpPos = data.position;
|
||||
//tmpPos[1] += 0.01;// move slightly to in x
|
||||
|
||||
_programObject->setUniform("ViewProjection", data.camera.viewProjectionMatrix());
|
||||
_programObject->setUniform("ModelTransform", transform);
|
||||
setPscUniforms(_programObject, &data.camera, data.position);
|
||||
setPscUniforms(_programObject, &data.camera, tmpPos);
|
||||
|
||||
// Bind texture
|
||||
ghoul::opengl::TextureUnit unit;
|
||||
|
||||
@@ -75,7 +75,7 @@ void SpiceEphemeris::update(const UpdateData& data) {
|
||||
|
||||
glm::dvec3 position(0,0,0);
|
||||
double lightTime = 0.0;
|
||||
SpiceManager::ref().getTargetPosition(_targetName, _originName, "GALACTIC", "NONE", data.time, position, lightTime);
|
||||
SpiceManager::ref().getTargetPosition(_targetName, _originName, "GALACTIC", "CN+S", data.time, position, lightTime);
|
||||
|
||||
_position = psc::CreatePowerScaledCoordinate(position.x, position.y, position.z);
|
||||
_position[3] += 3;
|
||||
|
||||
@@ -40,7 +40,7 @@ PowerScaledSphere::PowerScaledSphere(const PowerScaledScalar& radius, int segmen
|
||||
: _vaoID(0)
|
||||
, _vBufferID(0)
|
||||
, _iBufferID(0)
|
||||
, _mode(GL_LINES)
|
||||
, _mode(GL_TRIANGLES)
|
||||
, _isize(6 * segments * segments)
|
||||
, _vsize((segments + 1) * (segments + 1))
|
||||
, _varray(new Vertex[_vsize])
|
||||
|
||||
Reference in New Issue
Block a user