Paul Hoepner
Paul Hoepner

Reputation: 31

How to access single vertices of mesh loaded with GLTFLoader in Three.js

I am loading a glb-File using GLTFLoader in Three.js: Before I was using the JSONLoader. Accessing the vertices of the loaded mesh was easy:

meh.geometry.vertices

But when looking at the mesh loaded with GLTFloader, I just can not find, where the vertices are?

I need to manipulate each single vertex for some particle animation.

Thanks

Upvotes: 3

Views: 2776

Answers (1)

Maverick_sid
Maverick_sid

Reputation: 21

Use console.log(gltf)- To view the JSON file, then you will find everything in Scenes. To access the mesh use gltf.scene.traverse( function ( child ) {if ( child.isMesh ){ child.geometries.attributes...}}

Upvotes: 2

Related Questions