codecamp

three.js Face

表示以特定数量的半边为界的部分。当前的实现假设一张脸总是由三个边组成。

构造函数

Face()

创建一个新的 Face 实例。

属性

.normal : Vector3

面的法向量。默认值为 (0, 0, 0) 处的 Vector3。

.midpoint : Vector3

面的中点或质心。默认值为 (0, 0, 0) 处的 Vector3。

.area : Float

面部区域。默认为 0。

.constant : Float

从面到原点的符号距离。默认为 0。

.outside : VertexNode

引用此面可以看到的顶点列表中的顶点。默认为空。

.mark : Integer

标记面是否可见或已删除。默认为“可见”。

.edge : HalfEdge

参考面的底边。要检索所有边,您可以使用当前边的“下一个”引用。默认为空。

方法

.create ( a : VertexNode, b : VertexNode, c : VertexNode ) : Face

a - 面的第一个顶点。

b - 面的第二个顶点。

c - 面的第三个顶点。

创建一个面孔。

.getEdge ( i : Integer ) : HalfEdge

i - 边的索引。

返回给定索引的边。

.compute () : this

计算面部的所有属性。

.distanceToPoint ( point : Vector3 ) : Float

point - 3D 空间中的任意点。

返回从给定点到此面的平面表示的带符号距离。

源码

examples/jsm/math/ConvexHull.js


three.js OBB
three.js HalfEdge
温馨提示
下载编程狮App,免费阅读超1000+编程语言教程
取消
确定
目录

参考

核心 / BufferAttributes

渲染器 / WebXR

开发者参考

WebGL渲染器

关闭

MIP.setData({ 'pageTheme' : getCookie('pageTheme') || {'day':true, 'night':false}, 'pageFontSize' : getCookie('pageFontSize') || 20 }); MIP.watch('pageTheme', function(newValue){ setCookie('pageTheme', JSON.stringify(newValue)) }); MIP.watch('pageFontSize', function(newValue){ setCookie('pageFontSize', newValue) }); function setCookie(name, value){ var days = 1; var exp = new Date(); exp.setTime(exp.getTime() + days*24*60*60*1000); document.cookie = name + '=' + value + ';expires=' + exp.toUTCString(); } function getCookie(name){ var reg = new RegExp('(^| )' + name + '=([^;]*)(;|$)'); return document.cookie.match(reg) ? JSON.parse(document.cookie.match(reg)[2]) : null; }