我通过以下代码显示了一组 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);
此代码显示一个 3d 点云数组及其颜色值,我想获取一个 2d 点数组并以 2d 显示这些点(3d 点的上视图)