79 size_t n_points = buffer->numPoints();
80 floatArr points = buffer->getPointArray();
87 size_t w_color, dummy;
89 floatArr intensities = buffer->getFloatArray(
"intensities", n_points, dummy);
93 for(
size_t i = 0; i < n_points; i++)
95 float x = points[i*3 + 0];
96 float y = points[i*3 + 1];
97 float z = points[i*3 + 2];
101 unsigned char r, g, b;
105 r = colors[i*w_color + 0];
106 g = colors[i*w_color + 1];
107 b = colors[i*w_color + 2];
109 else if (intensities)
115 r = (
unsigned char)(color[0] * 255);
116 g = (
unsigned char)(color[1] * 255);
117 b = (
unsigned char)(color[2] * 255);
138 cout<<
"PointCloud::initDisplayList() delete display list"<<endl;
147 for(
size_t i = 0; i <
m_points.size(); i++)
172 glColor3f(1.0, 1.0, 0.0);
173 for(
size_t i = 0; i <
m_points.size(); i++)
190 glColor3f(1.0, 0.0, 1.0);
195 Vec end = start + normal * length;
197 glVertex3f(start[0], start[1], start[2]);
198 glVertex3f(end[0], end[1], end[2]);
void getColor(float *color, size_t bucket, GradientType gradient=GREY)
Returns three float values for the color of the given bucket.
void updateBuffer(PointBufferPtr buffer)
boost::shared_array< unsigned char > ucharArr
std::shared_ptr< PointBuffer > PointBufferPtr
A dynamic bounding box class.
void init(PointBufferPtr buffer)
boost::shared_array< float > floatArr
vector< uColorVertex > m_points
std::shared_ptr< Model > ModelPtr
BoundingBox< Vec > * m_boundingBox
void updateDisplayLists()
ColorVertex< float, unsigned char > uColorVertex