编程语言
首页 > 编程语言> > C++绘制点云 日志记录

C++绘制点云 日志记录

作者:互联网

C++绘制点云  

osg::Geode* pcd_geode = new osg::Geode();
//几何体
osg::Geometry* pcd_geometry = new osg::Geometry();

for (int k = 0; k < list_dall_data.size(); k++) {
    PTSData* indexPTSObj = list_dall_data.at(k);

    int w = indexPTSObj->getW();
    int h = indexPTSObj->getH();

    double    x = indexPTSObj->getX();
    double    y = indexPTSObj->getY();
    double    z = indexPTSObj->getZ();

    int r = indexPTSObj->getR();
    int g = indexPTSObj->getG();
    int b = indexPTSObj->getB();

    coord->at(k) = osg::Vec3(x, y, z);
    //颜色
    colors->at(k) = osg::Vec4(((float)(r)) / 255, ((float)(g)) / 255, ((float)(b)) / 255, 1.0f);

}

//设置顶点的关联方式
pcd_geometry->addPrimitiveSet(new osg::DrawArrays(osg::PrimitiveSet::POINTS, 0, points));
pcd_geode->addDrawable(pcd_geometry);

 

 

 

 

 

 

############################

标签:indexPTSObj,int,float,C++,pcd,点云,new,日志,osg
来源: https://www.cnblogs.com/herd/p/16153670.html