melowntech / vts-browser-cpp

VTS Browser C++ library
BSD 2-Clause "Simplified" License
53 stars 19 forks source link

Import .obj files in C++ version of VTS browser #13

Closed shrikant-panchal closed 4 years ago

shrikant-panchal commented 4 years ago

I observed that the vts-browser-js allows users to import models in .obj format using the ModelOBJ library. Could you please suggest, which library/API should be used to import the model in vts-browser-minimal-cpp?

Any help would be greatly appreciated!

malytomas commented 4 years ago

Simple OBJ models can be loaded in vts-browser-cpp.

The GpuMeshSpec in the vts-browser library has constructor that parses an obj from memory buffer: https://github.com/melowntech/vts-browser-cpp/blob/c0e8fac4177ef61973c735b04a96349d3a631b10/browser/src/vts-libbrowser/include/vts-browser/resources.hpp#L154 Be warned, this function can parse simple OBJ files only.

The Mesh class in vts-renderer library can load it into gpu memory: https://github.com/melowntech/vts-browser-cpp/blob/c0e8fac4177ef61973c735b04a96349d3a631b10/browser/src/vts-librenderer/include/vts-renderer/classes.hpp#L133

(Apologies for late reply, I did not notice this issue since I am not a maintainer for this repository)

shrikant-panchal commented 4 years ago

Thank you so much Tomos! It is definitely helpful!