【问题标题】:How to change the thickness of GridHelper lines?如何更改 GridHelper 线条的粗细?
【发布时间】:2018-02-02 18:17:00
【问题描述】:

我正在使用 Three.js (v0.86.0) 渲染一个网格:

let grid = new THREE.GridHelper(1000, 20);
scene.add(grid);

GridHelper 生成的线条似乎有 1 个像素的粗细。

我想将线条的粗细增加到 3 个像素,但不知道怎么做。我尝试更改grid.geometry.getAttribute("position").itemSize 的值,但它不起作用。

有什么想法吗?

【问题讨论】:

标签: javascript three.js geometry


【解决方案1】:

很遗憾,您无法在 Windows 上更改线条粗细。

这是因为GridHelper 在内部使用LineBasicMaterial,正如他们在documentation 中所写:“由于角度层的限制,Windows 平台上的 WebGL 渲染器的线宽将始终为 1”

【讨论】:

猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2011-02-02
  • 1970-01-01
  • 2022-08-16
  • 2018-10-13
  • 2020-03-03
  • 2020-08-23
  • 2013-07-28
相关资源
最近更新 更多