I have created a model using TinkerCad and downloaded it as and OBJ file. Then I used obj2gltf to convert it to glTF. I believe this could be a Cesium issue, let me know otherwise.
I use the following command to render the model:
node bin/obj2gltf.js -i sail_boat.obj -t phong -e
I load the object using:
var model = new Cesium.ModelGraphics({
id: ‘boat-model’,
uri: url,
minimumPixelSize: 100,
maximumScale: 1000,
scale: 0.05,
});
Then add it to the scene as an entity. The model displays but there is no shading, it’s just matt black, with some grey/white elements which are not matt and change as the scene is rotated. See an example:
I can change the “Materials” properties of the .gltf file, but this does not help.
Is there a way I can change the material properties once the object is loaded, using ModelGraphics()?
It looks like the website exports a somewhat broken obj file. The faces reference normals that don’t seem to exist and the obj doesn’t load correctly in any programs I’ve tried. I was able to clean up the obj a bit and export it correctly, but I would bring this issue up with tinkercad.
That’s great, thanks for your time for investigating and providing the fixed obj file. The fixed versions work well enough now. I suppose I need to learn to use Blender.