本文整理汇总了TypeScript中THREE.Geometry.computeLineDistances方法的典型用法代码示例。如果您正苦于以下问题:TypeScript Geometry.computeLineDistances方法的具体用法?TypeScript Geometry.computeLineDistances怎么用?TypeScript Geometry.computeLineDistances使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类THREE.Geometry
的用法示例。
在下文中一共展示了Geometry.computeLineDistances方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: _createMesh
_createMesh() {
let geometry = new THREE.Geometry();
// Vertical lines
let x = 0;
while(x <= this.width ) {
geometry.vertices.push(new THREE.Vector3(x / this.ratio.x, 0, 0));
geometry.vertices.push(new THREE.Vector3(x / this.ratio.x, this.direction * this.height / this.ratio.y, 0));
x += 1;
}
// Horizontal lines
let y = 0;
while(y <= this.height) {
geometry.vertices.push(new THREE.Vector3(0, this.direction * y / this.ratio.y, 0));
geometry.vertices.push(new THREE.Vector3(this.width / this.ratio.x, this.direction * y / this.ratio.y, 0));
y += 1;
}
geometry.computeLineDistances();
let material = new THREE.LineDashedMaterial({
color: 0x000000, transparent: true, opacity: 0.4,
dashSize: 5 / 1000, gapSize: 5 / 1000, scale: 1 / this.orthographicScale
});
this.mesh = new THREE.LineSegments(geometry, material);
this.actor.threeObject.add(this.mesh);
this.mesh.updateMatrixWorld(false);
}