geometry-central icon indicating copy to clipboard operation
geometry-central copied to clipboard

Feature request: Load texture baked in .obj files

Open HarryRos opened this issue 1 year ago • 1 comments

It is possible to save a texture within .obj files by defining an RGB colour on each vertex.

For instance, a .obj file with a vertex line as follows:

v 136 99 52 0.46 0.4 0.3

means a vertex at position (136 99 52) with RGB colour (0.46 0.4 0.3)

It would be great if the simple_polygon_mesh.cpp could be extended to load these colours, possibly into a VertexData<Vector3> structure?

...

if (token == "v") {
  Vector3 position;
  ss >> position;
  if (ss.tellg() >= 0)
  {
    Vector3 colour;
    ss >> colour;
    vertexColours.push_back(colour);
  }

...

HarryRos avatar Jul 11 '24 08:07 HarryRos

This makes sense, I'd be happy to merge a PR for this if anyone has time!

nmwsharp avatar Oct 01 '24 05:10 nmwsharp