THREE.js 线宽矛盾 [英] THREE.js linewidth contradiction

查看:31
本文介绍了THREE.js 线宽矛盾的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我注意到在 LineBasicMaterial 三个文档据说在 Windows 系统上 linewidth 会自动设置为 1 并且无法更改.

I noted that at the LineBasicMaterial THREE documentation is said that on Windows systems the linewidth is set-up automatically to 1 and cannot be changed.

另一方面,我们有一个 来自threejs.org 的非常酷的示例,使用相同的三个版本(r68) 在使用 Windows 系统的情况下,当鼠标悬停在场景中的一条线上时,线宽会从 1 修改为 5,从 5 修改为 1.

On the other hand we have a very cool example from threejs.org using the same THREE version (r68) where using a Windows system the linewidth gets modified from 1 to 5 and from 5 to 1 when the mouse overs one of the lines on the scene.

那么,我的问题是,这个参数可以修改吗?怎么做?我尝试简单地将 material.linewidth 设置为不同的数字,但没有效果.

So, my question is, can this parameter be modified? How to do it? I tried with simply set the material.linewidth to a different number but it had no effect.

推荐答案

您链接的示例使用 CanvasRenderer(不是 WebGLRenderer),这样做 支持 lineWidth.WebGLRenderer 但是必须依赖于 WebGL 实现提供的内容.

The example you linked uses the CanvasRenderer (not the WebGLRenderer) which does support lineWidth. WebGLRenderer however has to rely on what the WebGL implementation provides.

在 Windows 上,Chrome 和 Firefox 默认使用 ANGLE(位于 DirectX 之上的某个层),它支持 lineWidth.然而,Windows 上的 Firefox 可以切换到 OpenGL,然后(取决于显卡驱动程序)lineWidth 可能被支持.

On Windows, both Chrome and Firefox default to using ANGLE (some layer on top of DirectX) which does not support lineWidth. Firefox on Windows can however be switched to OpenGL, and then (depending on the video card drivers) lineWidth may be supported.

(Chrome 有一个命令行选项可以将其切换到 OpenGL 模式,但这不再是受支持的或功能性配置,它只是在启动时挂起……您无需费心尝试).

(Chrome has a command line option to switch it to OpenGL mode, but that's no longer a supported or functional configuration, it just hangs on startup ... you don't need to bother trying).

这篇关于THREE.js 线宽矛盾的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆