Change the appearance attribute but appearance did not change.

Hi all,

There is something I don't really understand. The thing is when I call a function that contain this piece of code:

g_widget.scene.getPrimitives()._primitives[0].appearance.flat = true;

From the console, the flat attribute did change. However, the targeted primitive did not change the appearance.

Am I missing something?

Thank you.

Dave

Hi Dave,

The appearance didn’t change because Primitive only checks to see if there is a new appearance or the material changed. We’re going to evaluate ES5 properties that would fix this problem. Until then, the work around is to change the material or create a new appearance.

Regards,

Dan

Hi Daniel,

Thank you for clarifying this.

I've made it through yesterday on creating flat like object simply by adding "normals : 'vec(1,1,1)'" into the fabric/component.

Dave

The flat property is explicitly marked readonly in the documentation. Unfortunately, as Dan mentioned, we can’t do a good job of enforcing it yet.

http://cesium.agi.com/Cesium/Build/Documentation/PerInstanceColorAppearance.html

Patrick

Hi Patrick,

Have just realised it. Thank you.

Dave