I’m loading an .obj
mesh with a texture in .png
image file (Ignition Robotics) and visualize it with this code snippet:
Mesh mesh = Mesh::load("/home/paul/st/models/banana.obj", Mesh::LOAD_OBJ);
Viz3d window{"Mesh"};
mesh.texture = imread("/home/paul/st/models/banana.png", IMREAD_COLOR);
window.setFullScreen();
window.setBackgroundColor(Color::gray());
window.showWidget("cs", WCoordinateSystem());
window.showWidget("m", WMesh(mesh));
window.resetCamera();
window.spin();
The texture is badly applied:
Any idea what went wrong? The same pair of files: banana.obj
and banana.png
, renders fine with other applications.