alwxkxk / iot-visualization-examples Goto Github PK
View Code? Open in Web Editor NEWiot visualization example
Home Page: https://alwxkxk.github.io/iot-visualization-examples
License: GNU General Public License v3.0
iot visualization example
Home Page: https://alwxkxk.github.io/iot-visualization-examples
License: GNU General Public License v3.0
Hi ! i'm trying to make some changes in this one project and I basically found out that i cannot coloriz an specific node based on name for example without all the other nodes being colorized as well. The following is a code snippet that i'm trying to use to colorize only the glass i'm clicking, but it ends colorizing all of them.
const loader = new THREE.GLTFLoader()
var selectedObject;
loader.load(model_, function (object) {
var model = object.scene;
renderer.render(scene, camera);
scene.add(model);
window.addEventListener('click', onMouseClick, false);
function onMouseClick(event) {
mouse.x = (event.clientX / window.innerWidth) * 2 - 1;
mouse.y = - (event.clientY / window.innerHeight) * 2 + 1;
raycaster.setFromCamera(mouse, camera);
var intersects = raycaster.intersectObjects(model.children, true);
if (intersects.length > 0) {
selectedObject = intersects[0].object;
console.log(selectedObject.name)
if (/(glass)[0-9]{0,}/.test(selectedObject.name)) {
selectedObject.material.color.set(0x00ff00);
}
}
}
});
Could you help me out with it ? maybe there's something hidden in your 3d model that i'm missing ?
Thanks in advance
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.