Ask Your Question
0

no display with triangle list a<1.0

asked 2015-01-17 11:44:37 -0500

aswin gravatar image

updated 2015-01-17 21:57:13 -0500

I cannot get to display the triangle_list with an alpha less than 1.0. Is this a known bug?

For reference below is my code. Basically I am trying to display a laser fan

 visualization_msgs::Marker scan_marker;
 scan_marker.header.frame_id = "/robot_0/base_laser_link";
 scan_marker.header.stamp = ros::Time::now();
 scan_marker.ns = "scan";
 scan_marker.type = visualization_msgs::Marker::TRIANGLE_LIST;
 scan_marker.action = visualization_msgs::Marker::ADD;
 scan_marker.id = 0;
 scan_marker.scale.x = scan_marker.scale.y = scan_marker.scale.z = 1.0;
 std_msgs::ColorRGBA scan_color;
 scan_marker.pose.position.x = 0.0;
 scan_marker.pose.position.y = 0.0;
 scan_marker.pose.position.z = 0.0;
 scan_marker.pose.orientation.x = 0.0;
 scan_marker.pose.orientation.y = 0.0;
 scan_marker.pose.orientation.z = 0.0;
 scan_marker.pose.orientation.w = 1.0;
 scan_color.a = 0.8f;
 scan_color.r = 0.25f;
 scan_color.g = 0.5f;
 scan_color.b = 0.9f;
 geometry_msgs::Point temp;

 for (int i = 0; i < cloud.points.size() - 1; i++) {
   for (int j = -1; j < 2; j++) {
     temp.x = j == -1 ? 0 : cloud.points[i + j].x;
     temp.y = j == -1 ? 0 : cloud.points[i + j].y;
     temp.z = j == -1 ? 0 : cloud.points[i + j].z;
     scan_marker.points.push_back(temp);
     scan_marker.colors.push_back(scan_color);
  }
}

Following is the image for alpha=1.0. There is nothing visible for alpha = 0.8 https://dl.dropboxusercontent.com/u/8...

edit retag flag offensive close merge delete

Comments

If you're looking for help with a rendering problem, you should post screenshots. In this particular case, screenshots showing alpha=1 and alpha=0.8 would be good.

ahendrix gravatar image ahendrix  ( 2015-01-17 18:39:32 -0500 )edit

I dont see anything displayed for the above. Updated with image for a=1.0

aswin gravatar image aswin  ( 2015-01-17 20:43:19 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2015-01-18 08:59:03 -0500

aswin gravatar image

updated 2015-01-18 09:00:19 -0500

I forgot to add color to the marker and only added color to the points. I got the transparency effect by removing the line

scan_marker.colors.push_back(scan_color);

and adding the following line outside the loop

scan_marker.color = scan_color;
edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2015-01-17 11:44:37 -0500

Seen: 472 times

Last updated: Jan 18 '15