我已经通过这个代码显示了一个3d云点的集合:
glEnableClientState(GL_VERTEX_ARRAY);
glEnableClientState(GL_COLOR_ARRAY);
if (keyframes[i]->numberOf3DPoints > 0)
{
glColorPointer(3, GL_UNSIGNED_BYTE, sizeof(PointColor), ((uint8_t*)keyframes[i]->points+12));
glVertexPointer(3, GL_FLOAT, sizeof(PointColor), ((float*)keyframes[i]->points));
glDrawArrays(GL_POINTS, 0, keyframes[i]->numberOf3DPoints);
}
glDisableClientState(GL_VERTEX_ARRAY);
glDisableClientState(GL_COLOR_ARRAY);这段代码显示了一个三维点云的数组及其颜色值,我想得到一个二维点的数组,并在二维(三维点的上方视图)中显示这些点。
发布于 2011-12-17 21:52:26
This projection tutorial详细解释了投影矩阵变换。
要从上方获得投影,请设置投影矩阵,并将相机设置在上方,并将其指向平面的方向。这应该就足够了。
https://stackoverflow.com/questions/8544952
复制相似问题