Model shading not working

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:
Auto Generated Inline Image 1.png

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()?

Attached is the glTF file.

sail_boat.gltf (108 KB)

Hello,

We have an issue open to look into this here: https://github.com/AnalyticalGraphicsInc/cesium/issues/3737

I’ve linked your forum post so someone can look at your model.

Best,

Hannah

Hi Simon, can you also upload the original obj model?

Hi Sean and Hannah,

Thanks for your support.

Attached is the OBJ file.

Here is the link to the original TinkerCad file:

Below is an image of what it should look like.
Auto Generated Inline Image 1.png

Regards,
Simon

sail_boat.obj (75.9 KB)

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.

ship.gltf (42.8 KB)

ship.obj (62.5 KB)

Hi Sean,

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.

I have raised an issue with TinkerCad support.

Regards,
Simon

The issue at #3737 has just been closed and may resolve your issue. Look for the change in Cesium 1.45 on May 1, or get it now in the master branch on GitHub https://github.com/AnalyticalGraphicsInc/cesium.