Where did geometry.vertices go in new colladaLoader

Hello, i am using .geometry.vertices to displace them with triggers. I am using DAE model that i load with DaeLoader. I wanted to include animation but since i use an old ColladaLoader it gives me an error :

“THREE.SkinnedMesh no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.”

However if i use a new ColladaLoader my script isnt working anymore because there is no vertices tag found in the geometry tag of the object so i can’t count and loop through the vertices? HELP!

on the left u see the same dae laoded with old loder. it has the vertices array under geometry. on the right u see the same dae with newest loader, and i cant find the vertices array to count through it length…
Bildschirmfoto 2020-03-04 um 20.56.50 Bildschirmfoto 2020-03-04 um 20.58.26

Like all other loaders, ColladaLoader returns instances of THREE.BufferGeometry. Consider the less efficient THREE.Geometry as deprecated. It’s not recommended to work with it anymore.

If you need access to the vertices of an instance of THREE.BufferGeometry, just read the position buffer attribute like so:

const positionAttribute = geometry.getAttribute( 'position' );
const vertex = new THREE.Vector3();

for ( let i = 0; i < positionAttribute.count; i ++ ) {

    vertex.fromBufferAttribute( positionAttribute, i );

    // now do something with vertex

1 Like

thank u for your fast answer. maybe i need to try and get the animation running instead, cause rewriting the complete script for geometry deformation will be extremely hard for me. right now it is working with the old colladaLoader, except for the animation of the dae.

right now i am following this example:

but it gives me this error:

“THREE.SkinnedMesh no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.”

and also:

TypeError: tracks is undefined

iirc BufferGeometry has the fromGeometry method, so you could use old ColladaLoader and whatever code you have that relies on geometry being Geometry, and then just do

bufferGeometry = new THREE.BufferGeometry();
bufferGeometry.fromGeometry( yourOldGeometry );