three.js
three.js copied to clipboard
Utils: Query selector
Description
I created an experimental version of the Query for Three.js that can help you select objects in a scene.
Live example
https://raw.githack.com/sunag/three.js/dev-query/examples/webgl_query.html

Query
SELECT Material WHERE transparent ORDER opacity DESC
Usage
const result = new Query( "SELECT Material WHERE transparent ORDER opacity DESC" ).from( scene );
Result

API
const queryString = "SELECT Material WHERE transparent ORDER opacity DESC";
//
const objects = new Query( queryString ).from( object3d );
// or
const query = new Query( queryString );
const selection1 = query.from( object3d );
const selection2 = query.from( isolateMesh3d );
This contribution is funded by Google