StandardCyborg / StandardCyborgSDK

A C++ SDK for 3D computer vision, paired with Cocoa frameworks for TrueDepth-based 3D scanning, meshing, and ML landmarking models + analysis for foot and ear
MIT License
47 stars 25 forks source link

Wrong mapped texture in .obj export? #10

Closed karloscampus closed 1 year ago

karloscampus commented 1 year ago

First of all, thank you for the Open Source Project, it is a really great and innovative library! Unfortunately I have problems loading the zip (.obj export) into Blender. I have the feeling that the texture is not mapped correctly to the surface. I only use the Example project and only run scene.mesh?.writeToOBJZip(atPath: documentsURL.appendingPathComponent("objzip").path) after creating the scene. Loaded in Blender an MeshLab looks like: untitled am I doing something wrong? Thanks in advance!

aaptho commented 1 year ago

Hah, looks like an art piece!

It’s possible the uv map coordinates are inverted. Are you able to flip them while importing into Blender? Or if you want to try inverting them in code, remove the 1.0 - from line SCMesh+FileIO.mm:117. (At least that’s where I think this code lives, it’s been a few years).

karloscampus commented 1 year ago

that is right. I flipped the output texture vertically and it matches! Thanks!!

aaptho commented 1 year ago

Great, glad it worked! Would you mind submitting a PR for that change?

The other file format export functions do not invert the value, so I don’t see why we should invert it here.

aaptho commented 1 year ago

Fixed with commit 0689b0