herrDeng網內搜尋

自訂搜尋

Ads

2023年12月13日 星期三

從bag檔中擷取Ply檔,並用3D軟體開啟,C++程式讀取


#include <iostream>
#include <fstream>
#include <string>
 
using namespace std;
int main()
{
    cout<<"讀取PLY檔前20行資訊\n";
     
    fstream fin("shiba0.ply");
    string tmp;
    do{
        getline(fin, tmp);
        cout<<tmp<<"\n";
    } while(tmp!="end_header");
    float x, y, z;
    float nx, ny, nz;
    unsigned R, G, B;
    fin>>x>>y>>z>>nx>>ny>>nz>>R>>G>>B;
    cout<<x<<","<<y<<","<<z<<"\n";
    cout<<nx<<","<<ny<<","<<nz<<"\n";
    cout<<R<<","<<G<<","<<B<<"\n";
    fin.close();
    return 0;
}

沒有留言:

Related Posts Plugin for WordPress, Blogger...

熱門文章