Skip to content

Commit

Permalink
Move glTranslate to gl-wrapper.hpp
Browse files Browse the repository at this point in the history
  • Loading branch information
yuki-koyama committed May 18, 2018
1 parent 41b37ad commit 3af9765
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
3 changes: 3 additions & 0 deletions three-dim-util/gl-wrapper.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,11 @@ namespace threedimutil
{
inline void glColor(const Eigen::Vector3d& c) { glColor3d(c(0), c(1), c(2)); }
inline void glColor(const Eigen::Vector3d& c, double a) { glColor4d(c(0), c(1), c(2), a); }

inline void glVertex(const Eigen::Vector2d& v) { glVertex2d(v(0), v(1)); }
inline void glVertex(const Eigen::Vector3d& v) { glVertex3d(v(0), v(1), v(2)); }

inline void glTranslate(const Eigen::Vector3d& t) { glTranslated(t(0), t(1), t(2)); }
}

#endif // GL_WRAPPER_HPP
8 changes: 2 additions & 6 deletions three-dim-util/glut-wrapper.cpp
Original file line number Diff line number Diff line change
@@ -1,18 +1,14 @@
#include "glut-wrapper.hpp"
#include <three-dim-util/gl.hpp>
#include <three-dim-util/gl-wrapper.hpp>
#include <list>
#include <Eigen/Geometry>

namespace threedimutil
{
using Eigen::Vector3d;
using Eigen::Matrix4d;

inline void glTranslate(const Eigen::Vector3d& t)
{
glTranslated(t(0), t(1), t(2));
}


void drawSphere(double r, const Vector3d& p, int res)
{
glPushMatrix();
Expand Down

0 comments on commit 3af9765

Please sign in to comment.