Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added an orthographic camera class to the main VGL code.
This is a fancy way of saying that I moved the OrthoCamera from the imageview example into the main codebase. :-)
- Loading branch information
Showing
5 changed files
with
76 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#include "vgl_orthocamera.h" | ||
|
||
namespace vgl { | ||
|
||
|
||
// | ||
// OrthoCamera METHODS | ||
// | ||
|
||
OrthoCamera::OrthoCamera(unsigned int pixelWidth, unsigned int pixelHeight) : | ||
BaseCamera(pixelWidth, pixelHeight) | ||
{ | ||
} | ||
|
||
|
||
void OrthoCamera::setupProjectionMatrix() | ||
{ | ||
int viewport[4]; | ||
glGetIntegerv(GL_VIEWPORT, viewport); | ||
glOrtho(viewport[0], viewport[2], viewport[1], viewport[3], -0.5, 0.5); | ||
} | ||
|
||
|
||
void OrthoCamera::setupModelViewMatrix() | ||
{ | ||
} | ||
|
||
|
||
} // namespace vgl | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#ifndef vgl_orthocamera_h | ||
#define vgl_orthocamera_h | ||
|
||
#include "vgl_basecamera.h" | ||
|
||
namespace vgl { | ||
|
||
|
||
class OrthoCamera : public vgl::BaseCamera | ||
{ | ||
public: | ||
OrthoCamera(unsigned int pixelWidth, unsigned int pixelHeight); | ||
|
||
virtual void setupProjectionMatrix(); | ||
virtual void setupModelViewMatrix(); | ||
}; | ||
|
||
|
||
} // namespace vgl | ||
|
||
#endif // vgl_orthocamera_h | ||
|