8 #ifndef PROJECT_GRAPHICS3D_H 9 #define PROJECT_GRAPHICS3D_H 16 #include <QOpenGLContext> 17 #include <QOpenGLFunctions> 18 #include <QOpenGLPaintDevice> 19 #include <QOpenGLShaderProgram> 20 #include <QOpenGLWidget> 26 #include <QMouseEvent> 28 #include <QWheelEvent> 33 class Graphics3D :
public QOpenGLWidget,
protected QOpenGLFunctions {
75 float _color1[3] = {0.364784, 0.513401, 0.952230};
76 float _color2[3] = {0.553970, 0.477397, 0.628871};
77 float _color3[3] = {0.335223, 0.768230, 0.277775};
89 void _DrawBox(
double depth,
double width,
double height);
99 glColor4f(color(0), color(1), color(2), color(3));
102 glTranslatef(position(0), position(1), position(2));
105 float lineWidth,
float headWidth,
float headLength);
162 void getHeightColor(
const double &height,
float &r,
float &g,
float &b);
163 void _SetRGBHeight(
const double &h,
const double &step,
const int &idx,
164 float &r,
float &g,
float &b);
169 #endif // PROJECT_GRAPHICS3D_H void resetGameController()
void keyPressEvent(QKeyEvent *event) override
void initializeGL() override
FirstOrderIIRFilter< Vec3< float >, float > _freeCamFilter
void getHeightColor(const double &height, float &r, float &g, float &b)
void keyReleaseEvent(QKeyEvent *e) override
size_t setupMiniCheetah(Vec4< float > color, bool useOld)
GameController _gameController
typename Eigen::Matrix< T, 3, 1 > Vec3
void _drawBlock(BlockVisualization &box)
GLuint _colUniformSolidColor
QOpenGLShaderProgram * _solidColorProgram
GLuint _normAttrColorArray
size_t setupCheetah3(Vec4< float > color, bool useOld)
void updateCameraMatrix()
void wheelEvent(QWheelEvent *e) override
void _Additional_Drawing(int pass)
QOpenGLShaderProgram * _colorArrayProgram
void configOpenGLPass(int pass)
Data structure to store robot model to be drawn.
void _translate(const Vec3< float > &position)
void _rotateZtoDirection(const Vec3< float > &direction)
GLuint _colAttrColorArray
Code to read the Logitech F310 Game Controller Creates a DriverCommand object to be sent to the robot...
GLuint _colAttrSolidColor
GamepadCommand _driverCommand
void mousePressEvent(QMouseEvent *event) override
typename Eigen::Matrix< T, 4, 1 > Vec4
void _MeshObstacleDrawing()
A simple first order filter.
void setAnimating(bool animating)
GamepadCommand & getDriverCommand()
void mouseReleaseEvent(QMouseEvent *event) override
void _drawArrow(ArrowVisualization &arrow)
Utility to load .obj files, containing 3D models of robots.
Vec3< double > _cameraTarget
void _DrawBox(double depth, double width, double height)
void _BoxObstacleDrawing()
GLuint _matrixUniformSolidColor
void _setColor(const Vec4< float > &color)
void _drawSphere(SphereVisualization &sphere)
void _SetRGBHeight(const double &h, const double &step, const int &idx, float &r, float &g, float &b)
GLuint _posAttrColorArray
GLuint _posAttrSolidColor
GLuint _normAttrSolidColor
void _drawCone(ConeVisualization &cone)
Graphics3D(QWidget *parent=0)
void mouseMoveEvent(QMouseEvent *event) override
GLuint _matrixUniformColorArray