-
-
Notifications
You must be signed in to change notification settings - Fork 36.1k
Open
Labels
Description
Describe the bug
Calling LineSegmentsGeometry.setPositions a second time with more line segments still only renders the amount of line segments specified in the first call. Everything works as expected if you call "dispose" before calling "setPositions" again.
I'm not exactly sure why it's happening. Perhaps it's an issue related to instanced geometry rendering?
To Reproduce
Steps to reproduce the behavior:
- Create a
LineSegments2object - Call
line.geometry.setPositionswith 1 line segment - See that it renders 1 line
- 1 second later call
line.geometry.setPositionswith 2 line segments - See that it only renders the first of the two lines
Code
line = new LineSegments2();
line.geometry.setPositions( [ 0, -0.5, 0, 0, 0.5, 0 ] );
setTimeout( () => {
// uncomment to display both lines
// line.geometry.dispose();
line.geometry.setPositions( [
0, -0.5, 0, -0.5, 0.5, 0,
0, 0, 0, 0.5, 0, 0,
] );
}, 1000 );Live example
https://jsfiddle.net/rhjeL01n/
Expected behavior
The correct amount of lines are rendered after calling "setPositions".
Screenshots
If applicable, add screenshots to help explain your problem (drag and drop the image).
Platform:
- Device: Desktop
- OS: Windows
- Browser: Chrome
- Three.js version: latest (r126)
beginnerJq