Lalle
Lalle

Reputation: 732

Use GeometryUtils.merge on several Line objects in THREE.js

I want to merge several thousands of Line objects into a single geometry with GeometryUtils.merge to reduce lag, but it doesn't seem to work on Line objects. Is it possible? My technical mind says you would need to redefine what a line is.

Upvotes: 0

Views: 741

Answers (2)

Amit Borhade
Amit Borhade

Reputation: 11

I was also facing this issue, and while searching bumped here. I solved this issue, for now,using third parameter for THREE.Line constructor. There are two types, THREE.LineStrip and THREE.LinePieces. I used later, it connects series of segments i.e. 0-1, 2-3 and so on, so I added set of vertices for a line like 0-1 1-2 2-3, and reset this sequence for next line. Hope it helps you, if you dont want to redefine Line implementation.

Upvotes: 1

WestLangley
WestLangley

Reputation: 104783

Yes. This is something you will have to do manually.

three.js r.58

Upvotes: 1

Related Questions