Skip to content
Browse files

Try really hard to make anti-aliasing as nice as possible for plotter…

…. This means increasing the default line width to 1.5 and making sure line antialiasing is enabled, depth test off etc.

Signed-off-by: Steven Lovegrove <stevenlovegrove@gmail.com>
  • Loading branch information...
1 parent bdef328 commit 9f01c8ccb44ebf7b9025eefdb80d2b223c410a9d @stevenlovegrove committed Mar 18, 2013
Showing with 12 additions and 3 deletions.
  1. +12 −3 pangolin/plotter.cpp
View
15 pangolin/plotter.cpp
@@ -195,7 +195,7 @@ void DataLog::Log(float v1, float v2, float v3, float v4, float v5, float v6)
}
Plotter::Plotter(DataLog* log, float left, float right, float bottom, float top, float tickx, float ticky)
- : log(log), track_front(true), mouse_state(0),lineThickness(1.0f), draw_mode(0), plot_mode(TIME_SERIES)
+ : log(log), track_front(true), mouse_state(0),lineThickness(1.5f), draw_mode(0), plot_mode(TIME_SERIES)
{
this->handler = this;
int_x[0] = int_x_dflt[0] = left;
@@ -327,24 +327,33 @@ void Plotter::DrawSequence(const DataSequence& x,const DataSequence& y)
void Plotter::Render()
{
+ glPushAttrib(GL_ENABLE_BIT | GL_COLOR_BUFFER_BIT | GL_LINE_BIT);
+
if( track_front )
{
vo[0] = log->x-int_x[1];
//const float d = int_x[1] - log->x
//int_x[0] -= d;
//int_x[1] -= d;
}
-
+
+ glClearColor(0.0, 0.0, 0.0, 0.0);
ActivateScissorAndClear();
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
gluOrtho2D(int_x[0]+vo[0], int_x[1]+vo[0], int_y[0]+vo[1], int_y[1]+vo[1]);
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
- glPushAttrib(GL_ENABLE_BIT);
+ glDisable(GL_MULTISAMPLE);
+
+ glLineWidth(1.5);
glEnable(GL_LINE_SMOOTH);
+ glHint( GL_LINE_SMOOTH_HINT, GL_NICEST );
+ glEnable (GL_BLEND);
+ glBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glDisable(GL_LIGHTING);
+ glDisable( GL_DEPTH_TEST );
DrawTicks();

0 comments on commit 9f01c8c

Please sign in to comment.
Something went wrong with that request. Please try again.