Making Model nodes transparent.
- Dominant language
- JavaScript
- Stars
- 15.7k
- Forks
- 3.9k
- Avg merge
- 4d 6h
- Merged PRs (30d)
- 34
Description
Hello Cesium team,
I have an employer who we are visualizing things that go up into space, like deep space. These things have many moving parts/nodes from a 3d model both externally and internally that we transform. The outer nodes are easily seen when they move, but the internal ones are not. Here's the problem. We can remove those nodes with show and hide which is great but say you want to keep an eye on the outside movements while seeing the inner workings move. I have posted this question to the forums and so I see many others have as well.
This doesn't just apply for space exploration cases, what if you want to see into only a section of a building, or check a satellites internal parts that can be telemetry driven, or if your 3d tile of a city has multiple node layers you could make the top skyscrapers transparent to see the more internal architecture, or if you want to see into santa's sack?
I know you already have the capability to grab individual nodes and show hide them from a model, you would only have to change the alpha or transparency of that node.
We have a way now to do this but it requires setting the model opaque, diving into the gltf, finding the nodes we don't want to be transparent by traversing the heiarchy, determining the child nodes we want to affect, and deleting the translucent command for all other nodes.
let a = primitive._runtime.nodesByName[node.name];
let b = a.commands[i];
delete b.translucentCommand;
The big problem with this is that you can only make one node transparent at a time and always to the same level of transparency based off of the overall models transparency. For instance what if some thing has multiple layers to it you would have to bring the alpha to 0.36 to see through it wheras that would be too much for another node that would only need to be brought to 0.85.
Contributor guide
Research direction
Start by reading the model's glTF node handling and the runtime entry point shown in the issue: primitive._runtime.nodesByName and each node's commands. Define how per-node transparency should work for multiple nodes and transparency levels. Done means model nodes can be assigned independent transparency without directly modifying internal runtime commands.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- computer-graphics
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100