WIP3: problems with texture coordinates, needs fix.

This commit is contained in:
michal
2014-08-26 19:26:09 -04:00
parent de3827ee39
commit 8f3bcdeb54
14 changed files with 183 additions and 310 deletions

View File

@@ -30,6 +30,8 @@
#include <openspace/properties/stringproperty.h>
// ghoul includes
#include <ghoul/opengl/programobject.h>
#include <ghoul/opengl/texture.h>
namespace openspace{
@@ -44,17 +46,23 @@ public:
void render(const Camera* camera, const psc& position) override;
void update() override;
protected:
void loadTexture();
private:
std::ifstream& skipToLine(std::ifstream& file, unsigned int num);
bool readSpeckFile(const std::string& path);
properties::StringProperty _colorTexturePath;
ghoul::opengl::ProgramObject* _programObject;
ghoul::opengl::Texture* _texture;
std::string _speckPath;
GLuint _vboID;
GLuint _vaoID;
//GLint positionAttrib;
GLint positionAttrib;
int v_size;
};

View File

@@ -97,6 +97,15 @@ public:
void setPosition(psc pos);
const psc& position() const;
void setModelMatrix(glm::mat4 modelMatrix);
const glm::mat4& modelMatrix() const;
void setViewMatrix(glm::mat4 viewMatrix);
const glm::mat4& viewMatrix() const;
void setProjectionMatrix(glm::mat4 projectionMatrix);
const glm::mat4& projectionMatrix() const;
void setViewProjectionMatrix(glm::mat4 viewProjectionMatrix);
const glm::mat4& viewProjectionMatrix() const;
@@ -126,10 +135,12 @@ private:
float _sinMaxFov;
psc _position;
glm::mat4 _viewProjectionMatrix;
glm::mat4 _modelMatrix;
glm::mat4 _viewMatrix;
glm::mat4 _projectionMatrix;
glm::vec3 _viewDirection;
glm::vec3 _cameraDirection;
glm::vec2 _scaling;
glm::quat _viewRotation;
glm::mat4 _viewRotationMatrix; // compiled from the quaternion

View File

@@ -61,6 +61,7 @@ namespace renderableplanet {
namespace renderablestars {
const std::string keySpeckFile = "SpeckFile";
const std::string keyPathModule = "ModulePath";
} // namespace renderablestars
namespace planetgeometry {