three.js icon indicating copy to clipboard operation
three.js copied to clipboard

Utils: Query selector

Open sunag opened this issue 3 years ago • 0 comments

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

image

Query

SELECT Material WHERE transparent ORDER opacity DESC

Usage

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

Result

image

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

sunag avatar Nov 02 '22 06:11 sunag