Skip to content

Instantly share code, notes, and snippets.

@feliwir
Created March 2, 2015 21:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save feliwir/d3ddf74c86b577860513 to your computer and use it in GitHub Desktop.
Save feliwir/d3ddf74c86b577860513 to your computer and use it in GitHub Desktop.
Camera::Camera()
{
m_pos = glm::vec3(100.0f, 100.0f,100.0f);
m_up = glm::vec3(0.0f, 1.0f, 0.0f);
m_center = glm::vec3(0.0f, 0.0f, 0.0f);
m_ratio = 4.0f / 3.0f;
m_fov = 75.0f;
m_clip_near = 0.1f;
m_clip_far = 10000.0f;
m_model = glm::mat4(1.0f);
m_view = glm::lookAt(m_pos, m_center, m_up);
m_projection = glm::perspective(m_fov, m_ratio, m_clip_near, m_clip_far);
m_mvp = m_projection* m_view * m_model;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment