Hello folks. i did something but i am in trouble now. Can someone help me?
In this code, i success to add flow to curve. But as you see, geometry is a BoxGeometry.
My purpose is changes Box Geometry with any .glb file. I know i need to use Loader and clone instanced meshes for 4000 glb files.
I tried with ChatGpt, it is not enough for this or i cant manage.
Can someone show the right way?
const curve = new THREE.CatmullRomCurve3( curveVertices );
curve.curveType = 'chordal';
curve.closed = false;
const geometry = new BoxGeometry(0.06,0.06,0.06);
const material1 = new THREE.MeshPhongMaterial( {
color: 0xff0000,
stencilWrite: true,
stencilRef: 1,
stencilFunc: THREE.EqualStencilFunc,
stencilFail: THREE.KeepStencilOp,
stencilZFail: THREE.KeepStencilOp,
stencilZPass: THREE.KeepStencilOp, } );
const numberOfInstances1 = 4000;
let flow1 = new InstancedFlow( numberOfInstances1, curves.length, geometry, material1 );
curves.forEach( function ( { curve }, i ) {
flow1.updateCurve( i, curve );
scene.add( flow1.object3D );
} );