aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthias P. Braendli <matthias.braendli@mpb.li>2015-11-12 07:44:03 +0100
committerMatthias P. Braendli <matthias.braendli@mpb.li>2015-11-12 07:44:03 +0100
commit0ce4b2fe674e88a29fecfd9b7445b37747b6455d (patch)
treeb9c00e617275b6e2873aa8ac047e1c0c54529163
parentfe7413de47c83020bab5b5b603e446c139497174 (diff)
downloadodr-dpd-0ce4b2fe674e88a29fecfd9b7445b37747b6455d.tar.gz
odr-dpd-0ce4b2fe674e88a29fecfd9b7445b37747b6455d.tar.bz2
odr-dpd-0ce4b2fe674e88a29fecfd9b7445b37747b6455d.zip
Make points transparent
-rw-r--r--pointcloud.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/pointcloud.cpp b/pointcloud.cpp
index d762366..3bdccce 100644
--- a/pointcloud.cpp
+++ b/pointcloud.cpp
@@ -46,6 +46,9 @@ PointCloud::PointCloud(size_t num_points) :
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
gluPerspective(6,(double)640/480,1,1000);
+
+ glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
+ glEnable(GL_BLEND);
}
// Not really a border, but you get the idea
@@ -172,11 +175,11 @@ void PointCloud::draw()
0.5,0.5,0,
0,1,0);
- glPointSize(4.0);
+ glPointSize(3.0);
glBegin(GL_POINTS);
for (size_t n = 0; n < v.size(); n++){
- glColor3ub(v[n].r, v[n].g, v[n].b);
+ glColor4ub(v[n].r, v[n].g, v[n].b, 50);
glVertex3d(v[n].x, v[n].y, v[n].z);
}
glEnd();