# \#line2

**URL:** https://discourse.threejs.org/tag/line2/784.md

[Latest](https://discourse.threejs.org/latest.md) · [Categories](https://discourse.threejs.org/categories.md) · [Tags](https://discourse.threejs.org/tags.md)

---

## [Line2 objects appear jagged when making curves](https://discourse.threejs.org/t/line2-objects-appear-jagged-when-making-curves/87370)

<div class="topic-metadata">

**Author:** [@Lucas\_Lamonier](https://discourse.threejs.org/u/Lucas_Lamonier)\
**Replies:** 6\
**Last updated:** [October 6, 2025, 4:44am UTC](https://discourse.threejs.org/t/line2-objects-appear-jagged-when-making-curves/87370 "2025-10-06T04:44:54Z")

</div>

I need to implement curves that look like the following: I was provided the SVGs for these lines, which I imported into Blender and exported as a JSON file with the positions of each vertex. The data I got was in the…

---

## [Manipulate vertices in Line2Segments / Line2Node material in compute shader](https://discourse.threejs.org/t/manipulate-vertices-in-line2segments-line2node-material-in-compute-shader/86984)

<div class="topic-metadata">

**Author:** [@met](https://discourse.threejs.org/u/met)\
**Replies:** 0\
**Last updated:** [September 14, 2025, 8:06pm UTC](https://discourse.threejs.org/t/manipulate-vertices-in-line2segments-line2node-material-in-compute-shader/86984 "2025-09-14T20:06:44Z")

</div>

I’m learning webGPU, and I am trying to animate vertices of a line geometry using compute shader logic and the beautiful feature of TSL! I read a few topics here, in particular this one . I set up everything properly a…

---

## [Why is this happening?](https://discourse.threejs.org/t/why-is-this-happening/85195)

<div class="topic-metadata">

**Author:** [@orange001122](https://discourse.threejs.org/u/orange001122)\
**Replies:** 2\
**Last updated:** [July 15, 2025, 3:01pm UTC](https://discourse.threejs.org/t/why-is-this-happening/85195 "2025-07-15T15:01:24Z")

</div>

Why do I draw a line2 and there is a black rectangle in the center of the world? :frowning:

---

## [Drawing Line2 Issue](https://discourse.threejs.org/t/drawing-line2-issue/78790)

<div class="topic-metadata">

**Author:** [@KHades95](https://discourse.threejs.org/u/KHades95)\
**Replies:** 5\
**Last updated:** [March 1, 2025, 10:49pm UTC](https://discourse.threejs.org/t/drawing-line2-issue/78790 "2025-03-01T22:49:42Z")

</div>

Hello everyone, First of all, a big thank you to the Three.js support team and the community for all the amazing work and help! I’m currently working on drawing a polygon using Line2 from three.js (via three/examples/j…

---

## [Modify LineMaterial (Line2) to create glowing lines, but when the viewpoint is rotated, vUv.x changes, resulting in significant differences compared to when viewed directly](https://discourse.threejs.org/t/modify-linematerial-line2-to-create-glowing-lines-but-when-the-viewpoint-is-rotated-vuv-x-changes-resulting-in-significant-differences-compared-to-when-viewed-directly/75034)

<div class="topic-metadata">

**Author:** [@stan200096](https://discourse.threejs.org/u/stan200096)\
**Replies:** 0\
**Last updated:** [December 10, 2024, 10:14am UTC](https://discourse.threejs.org/t/modify-linematerial-line2-to-create-glowing-lines-but-when-the-viewpoint-is-rotated-vuv-x-changes-resulting-in-significant-differences-compared-to-when-viewed-directly/75034 "2024-12-10T10:14:40Z")

</div>

In the LineMaterial version of Line2, I use vUv.x to create glowing lines, aiming to achieve high brightness at the center of the lines and gradually fading towards the edges. However, unfortunately, when I observe t…

---

## [Adding points/drawCount for Line2 dynamically](https://discourse.threejs.org/t/adding-points-drawcount-for-line2-dynamically/48980)

<div class="topic-metadata">

**Author:** [@Frank\_Avencast](https://discourse.threejs.org/u/Frank_Avencast)\
**Replies:** 5\
**Last updated:** [August 12, 2024, 6:41am UTC](https://discourse.threejs.org/t/adding-points-drawcount-for-line2-dynamically/48980 "2024-08-12T06:41:43Z")

</div>

Hi, I’m trying to solve the problem using a line with width (Line2 currently) and I need to update the line, like driving a car passing several points and leaving the trajectory. I think for the basic THREE.line case, …

---

## [【Line2】 displays differently from different perspectives](https://discourse.threejs.org/t/line2-displays-differently-from-different-perspectives/62767)

<div class="topic-metadata">

**Author:** [@wc19950724](https://discourse.threejs.org/u/wc19950724)\
**Replies:** 2\
**Last updated:** [March 14, 2024, 6:24am UTC](https://discourse.threejs.org/t/line2-displays-differently-from-different-perspectives/62767 "2024-03-14T06:24:47Z")

</div>

Why does the display effect of Line2 change when moving the camera? I have observed that it seems to rotate along with the camera. How to eliminate this difference

---

## [React-three-drei Overlap \<Line\> component vertice point with Html without affecting the prespective of the scene](https://discourse.threejs.org/t/react-three-drei-overlap-line-component-vertice-point-with-html-without-affecting-the-prespective-of-the-scene/55733)

<div class="topic-metadata">

**Author:** [@SrMarcius](https://discourse.threejs.org/u/SrMarcius)\
**Replies:** 3\
**Last updated:** [September 7, 2023, 9:46am UTC](https://discourse.threejs.org/t/react-three-drei-overlap-line-component-vertice-point-with-html-without-affecting-the-prespective-of-the-scene/55733 "2023-09-07T09:46:31Z")

</div>

Hi, im fairly new to threejs and react-three and im working on a project that consists of various points in a scene conected by a line, these points have the Html react three drei component. My objective is to prevent t…

---

## [How do I resize Line2?](https://discourse.threejs.org/t/how-do-i-resize-line2/54648)

<div class="topic-metadata">

**Author:** [@1\_1](https://discourse.threejs.org/u/1_1)\
**Replies:** 1\
**Last updated:** [August 4, 2023, 4:12pm UTC](https://discourse.threejs.org/t/how-do-i-resize-line2/54648 "2023-08-04T16:12:21Z")

</div>

I figured out that the geometry of Line2 doesn’t scale with position. Even if Position is adjusted, instanceStart and instanceEnd are not adjusted. How do I resize Line2? Anyone know how to do this?

---

## [An error is reported when using the setPositions method in geometry to set the position of line2](https://discourse.threejs.org/t/an-error-is-reported-when-using-the-setpositions-method-in-geometry-to-set-the-position-of-line2/54452)

<div class="topic-metadata">

**Author:** [@fukuin](https://discourse.threejs.org/u/fukuin)\
**Replies:** 3\
**Last updated:** [August 4, 2023, 1:13am UTC](https://discourse.threejs.org/t/an-error-is-reported-when-using-the-setpositions-method-in-geometry-to-set-the-position-of-line2/54452 "2023-08-04T01:13:24Z")

</div>

i have a lot of lines, and the effect I want to achieve is to make them thicker and change color when the mouse touches them. My code: // ... // when creating a scene let line\_g = new LineGeometry(); let mat = new Lin…

---

## [Circle opacity is incorrect](https://discourse.threejs.org/t/circle-opacity-is-incorrect/54496)

<div class="topic-metadata">

**Author:** [@1\_1](https://discourse.threejs.org/u/1_1)\
**Replies:** 6\
**Last updated:** [August 2, 2023, 9:07am UTC](https://discourse.threejs.org/t/circle-opacity-is-incorrect/54496 "2023-08-02T09:07:52Z")

</div>

Circle is created with an incorrect opacity. This usually results in much darker than desired opacity. This is the circle shape creation code. const geometry = new Shape().absarc(startPoint.x, startPoint.y, startPoint…

---

## [Line2 Not rendering properly](https://discourse.threejs.org/t/line2-not-rendering-properly/47966)

<div class="topic-metadata">

**Author:** [@ZarNi](https://discourse.threejs.org/u/ZarNi)\
**Replies:** 2\
**Last updated:** [April 7, 2023, 4:59pm UTC](https://discourse.threejs.org/t/line2-not-rendering-properly/47966 "2023-04-07T16:59:10Z")

</div>

I’m trying to build the drawing Line function with pointerMove and pointerDown Effect. I noticed that linewidth is not working at the linebasicmaterial. So I used the line2. I took the reference for drawing the line f…

---

## [Line2 and MapLibre projection](https://discourse.threejs.org/t/line2-and-maplibre-projection/49639)

<div class="topic-metadata">

**Author:** [@zeroFire](https://discourse.threejs.org/u/zeroFire)\
**Replies:** 6\
**Last updated:** [March 28, 2023, 2:14am UTC](https://discourse.threejs.org/t/line2-and-maplibre-projection/49639 "2023-03-28T02:14:40Z")

</div>

Using this maplibre example, Add a 3D model with three.js | MapLibre GL JS Docs | MapLibre and these three.js examples, three.js/examples/jsm/lines at master · mrdoob/three.js · GitHub -Updated with newer codepen- Lin…

---

## [How to update Line2 dynamically?](https://discourse.threejs.org/t/how-to-update-line2-dynamically/37913)

<div class="topic-metadata">

**Author:** [@drcmda](https://discourse.threejs.org/u/drcmda)\
**Replies:** 10\
**Last updated:** [August 24, 2022, 1:18pm UTC](https://discourse.threejs.org/t/how-to-update-line2-dynamically/37913 "2022-08-24T13:18:42Z")

</div>

sandbox: Threejs basic example (forked) - CodeSandbox const buffer = new Float32Array(\[0,0,0, 1,1,0, 2,0,0, 1,-1,0\]) const material = new LineMaterial({ color: 0xffffff }) const geometry = new LineGeometry() geometry.se…

---

## [BoxHelper with Fat line](https://discourse.threejs.org/t/boxhelper-with-fat-line/32350)

<div class="topic-metadata">

**Author:** [@skypu3](https://discourse.threejs.org/u/skypu3)\
**Replies:** 0\
**Last updated:** [December 4, 2021, 8:03am UTC](https://discourse.threejs.org/t/boxhelper-with-fat-line/32350 "2021-12-04T08:03:28Z")

</div>

import \* as THREE from 'three'; import { LineMaterial } from 'three/examples/jsm/lines/LineMaterial.js'; import { LineGeometry } from 'three/examples/jsm/lines/LineGeometry'; import { Line2 } from 'three/examples/jsm/lin…

---

## [Is it possible to texture map a Line](https://discourse.threejs.org/t/is-it-possible-to-texture-map-a-line/31668)

<div class="topic-metadata">

**Author:** [@dugla](https://discourse.threejs.org/u/dugla)\
**Replies:** 8\
**Last updated:** [November 12, 2021, 4:12pm UTC](https://discourse.threejs.org/t/is-it-possible-to-texture-map-a-line/31668 "2021-11-12T16:12:59Z")

</div>

I am using LineGeometry, LineMaterial to create a Line2 mesh object. I am currently using vertex colors. Is it possible to apply a texture to a Line2 For context:

---

## [Mirroring Line2 over a single axis](https://discourse.threejs.org/t/mirroring-line2-over-a-single-axis/15403)

<div class="topic-metadata">

**Author:** [@jacopocolo](https://discourse.threejs.org/u/jacopocolo)\
**Replies:** 3\
**Last updated:** [May 4, 2021, 9:48am UTC](https://discourse.threejs.org/t/mirroring-line2-over-a-single-axis/15403 "2021-05-04T09:48:58Z")

</div>

Hello everyone, I’m attempting to use Line2 for a small application and I’d like to implement a mirroring function over the axis. I’m struggling however to use makeScale to flip a Line2 object over a single axis. When I …

---

## [Making a line2 with dashed material](https://discourse.threejs.org/t/making-a-line2-with-dashed-material/19322)

<div class="topic-metadata">

**Author:** [@dan.dep](https://discourse.threejs.org/u/dan.dep)\
**Replies:** 2\
**Last updated:** [October 1, 2020, 3:54pm UTC](https://discourse.threejs.org/t/making-a-line2-with-dashed-material/19322 "2020-10-01T15:54:36Z")

</div>

Hi, I’m trying to make a line2 with dashed material. The geometry is a LineGeometry() and the material is LineMaterial(). I saw the examples (https://github.com/mrdoob/three.js/blob/22ed6755399fa180ede84bf18ff6cea0ad66f…
