meshcat-dev / meshcat

Remotely-controllable 3D viewer, built on top of three.js
MIT License
256 stars 48 forks source link

Help with opacity configuration #153

Closed SeanCurtis-TRI closed 1 year ago

SeanCurtis-TRI commented 1 year ago

Previously, setting the opacity of an object required setting the color of the object. Now, opacity can be set directly. Furthermore, the opacity can be modulated so that the material's intrinsic opacity can be scaled by an external factor (e.g., a slider).

The user can now call set_property(path, "opacity", value) or set_property(path, "modulated_opacity", value) to modify the opacity of all of the materials rooted at path. (Note: the "all materials rooted at path" was the previously existing behavior for setting the "color" property. Now it is made more explicit in the code.)

A new test web page has been added in which objects with various configurations can interactively have their opacity modified.


This change is Reviewable

SeanCurtis-TRI commented 1 year ago

Note to reviewers: Open opacity.html in your local browser. There are printed instructions/explanations. Ultimately, play with the sliders and convince yourself it is behaving as you would expect.

jwnimmer-tri commented 1 year ago

The top-level README documents how all of the features work. When we're adding new features, we should document their API/semantics there as well.