0

I use a .glb object and want to bend it. I tried to use the information in Three.js 3D Text Bending

So, now it does not work. The Error is:

BendModifiers.js:57 Uncaught (in promise) TypeError: Cannot read property 'length' of undefined

The line is: for (var i = 0; i < geometry.vertices.length; i++) {

My Code:

glbLoader.load('3d_models/ed-object.glb', function (geometry,) {
   staticObj = geometry.scene.children[0];

   ...

   var direction = new THREE.Vector3(0, 0, -1);
   var axis = new THREE.Vector3(0, 1, 0);
   var angle = Math.PI / 6;

   var modifier = new THREE.BendModifier();

   modifier.set(direction, axis, angle).modify( staticObj.geometry );
}

Hope you can help me.

KIM
  • 13
  • 3
  • BendModifier looks older, I'm not sure whether it works with newer versions of three.js. There's some discussion in the question you link to, but at minimum you need to do `mesh.geometry = new THREE.Geometry().fromBufferGeometry(mesh.geometry)` for each mesh in the model. – Don McCurdy May 29 '18 at 23:56
  • Thank you @DonMcCurdy this is working so far :) , but now I get the error `THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.` Perhaps you know what it is... – KIM May 30 '18 at 07:07
  • I think you'll need to create a demo reproducing the problem; like on Codepen, Glitch, or JSFiddle. Otherwise I can only guess. :) – Don McCurdy Jun 01 '18 at 05:06

0 Answers0