返回介绍

手册

参考

示例

开发者参考

VertexTangentsHelper

发布于 2021-07-10 14:14:19 字数 2412 浏览 1122 评论 0 收藏 0

Renders arrows to visualize an object's vertex tangent vectors. Requires that tangents have been specified in a custom attribute or have been calculated using computeTangents.

This helper supports BufferGeometry only.

代码示例

const geometry = new THREE.BoxGeometry( 10, 10, 10, 2, 2, 2 );
const material = new THREE.MeshNormalMaterial();
const box = new THREE.Mesh( geometry, material );
const helper = new VertexTangentsHelper( box, 1, 0x00ffff, 1 );
scene.add( box );
scene.add( helper );

例子

WebGL / helpers

Constructor

VertexTangentsHelper( object : Object3D, size : Number, color : Hex, linewidth : Number )

object -- object for which to render vertex tangents.
size -- (optional) length of the arrows. Default is 1.
color -- hex color of the arrows. Default is 0x00ffff.
linewidth -- (optional) width of the arrow lines. Default is 1. (Setting lineWidth is currently not supported.)

Properties

See the base LineSegments class for common properties.

.matrixAutoUpdate : Object

See Object3D.matrixAutoUpdate. Set to false here as the helper is using the objects's matrixWorld.

.object : Object3D

The object for which the vertex tangents are being visualized.

.size : Number

Length of the arrows. Default is 1.

Methods

See the base LineSegments class for common methods.

.update () : null

Updates the vertex tangents preview based on the object's world transform.

Source

examples/jsm/helpers/VertexTangentsHelper.js

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文