Skip to content

Commit

Permalink
PointCloud: add opacity/transparency option for material
Browse files Browse the repository at this point in the history
  • Loading branch information
Viktor Kunovski committed Jun 8, 2017
1 parent a686f82 commit 387f7de
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 4 deletions.
11 changes: 10 additions & 1 deletion build/ros3d.js
Original file line number Diff line number Diff line change
Expand Up @@ -854,6 +854,8 @@ ROS3D.PointCloud = function(options) {
this.height = options.height || 480;
this.whiteness = options.whiteness || 0;
this.queue_length = options.queue_length || 0;
this.opacity = options.opacity || 1;
this.transparent = options.transparent || false;

var ros = options.ros;
var topic = options.topic;
Expand All @@ -866,7 +868,14 @@ ROS3D.PointCloud = function(options) {
this.geometry.vertices.push(vertex);
this.geometry.colors.push( new THREE.Color() );
}
this.mesh = new THREE.PointCloud( this.geometry, new THREE.PointCloudMaterial( { size: this.pointSize / 1000.0 } ) );
this.mesh = new THREE.PointCloud(
this.geometry,
new THREE.PointCloudMaterial({
size: this.pointSize / 1000.0,
opacity: this.opacity,
transparent: this.transparent
})
);
this.mesh.material.vertexColors = THREE.VertexColors;

// if we don't clear this, the PC gets undrawn when we get too close with the camera, even if it doesn't seem close.
Expand Down
Loading

0 comments on commit 387f7de

Please sign in to comment.