-
-
Notifications
You must be signed in to change notification settings - Fork 36.1k
Description
Description
Hello. Ive been on your discord server but well, it is pretty much dead. Like, super dead. So here i am.
I got a few questions, hope you can explain me why
First, why BufferGeometry.setAtrtribute expects a string? Aren't string generally bad? I mean, when a string is constructed, it is stored on the... heap(?) or stack?? Cant remember exactly, but is a waste of memory.
Wouldn't be better to just call BufferGeometry.setPosition() or setColor() or something? I would like to know why the string argument.
And also, when working with such buffer like
this.#geometry = new THREE.BufferGeometry();
const positions = new Float32Array(this.stars * 2);
for (let i = 0; i < positions.length; i++) {
positions[i] = (Math.random() - 0.5) * 2500;
}
this.#geometry.setAttribute("position", new THREE.BufferAttribute(positions, 2));
this.#material = new THREE.PointsMaterial({color: 0xffffff});
this.#points = new THREE.Points(this.#geometry, this.#material);
this.#scene.add(this.#points);
}This throws me this error
THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.
Which makes sense because i am on 2D, and spheres do not exist on 2D, but why?
Solution
I'd really love to get the server more active, but well, I guess that depends on the community itself.
Alternatives
Thanks for your work and time :)
Additional context
No response