herrDeng網內搜尋

自訂搜尋

Ads

2023年12月13日 星期三

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


  1. #include <iostream>
  2. #include <fstream>
  3. #include <string>
  4. using namespace std;
  5. int main()
  6. {
  7. cout<<"讀取PLY檔前20行資訊\n";
  8. fstream fin("shiba0.ply");
  9. string tmp;
  10. do{
  11. getline(fin, tmp);
  12. cout<<tmp<<"\n";
  13. } while(tmp!="end_header");
  14. float x, y, z;
  15. float nx, ny, nz;
  16. unsigned R, G, B;
  17. fin>>x>>y>>z>>nx>>ny>>nz>>R>>G>>B;
  18. cout<<x<<","<<y<<","<<z<<"\n";
  19. cout<<nx<<","<<ny<<","<<nz<<"\n";
  20. cout<<R<<","<<G<<","<<B<<"\n";
  21. fin.close();
  22. return 0;
  23. }
  24.  

沒有留言:

Related Posts Plugin for WordPress, Blogger...

熱門文章