Replies: 1 comment 1 reply
-
Got this issue fixed finally. The main issue was that I needed to convert the position, color, and normals array to a Float32Array() and the index to a Uint32Array(). After putting a ref on the bufferGeometry, I put the following in a useEffect(). geometry.current.attributes.color.array = colors;
geometry.current.attributes.color.count = colors.length / 3;
geometry.current.index.array = new Uint32Array(indices);
geometry.current.index.count = indices.length;
geometry.current.attributes.position.array = new Float32Array(vertices);
geometry.current.attributes.position.count = vertices.length / 3;
geometry.current.attributes.normal.array = new Float32Array(normals);
geometry.current.attributes.normal.count = normals.length / 3; |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi, I am currently trying to get the example from https://threejs.org/examples/?q=buffer#webgl_buffergeometry_indexed (Three.js code found https://github.com/mrdoob/three.js/blob/master/examples/webgl_buffergeometry_indexed.html) working within a React-Three-Fiber environment. There are several issues that I'm currently seeing within my code.
First, specifically in Chrome, I am repeatedly getting the following warning:
In addition, I cannot currently see the mesh being displayed in the scene.
Here is the code that I have working so far. I have also created a Sandbox here: https://codesandbox.io/s/modest-mendeleev-5k1bw. Any suggestions / feedback welcome.
Beta Was this translation helpful? Give feedback.
All reactions