gpt4 book ai didi

javascript - 三.js虚线圆

转载 作者:行者123 更新时间:2023-11-27 22:58:16 29 4
gpt4 key购买 nike

按照虚线的模式,我尝试了这个,但它没有给我一个虚线圆圈(并不奇怪)。

var dashMaterial = new THREE.LineDashedMaterial( { color: 0xee6666, dashSize: 0.5, gapSize: 0.5  } ),
circGeom = new THREE.CircleGeometry( 10, 20 );
circGeom.computeLineDistances();
circGeom.vertices.shift();
var circ = new THREE.Line( circGeom, dashMaterial);
scene.add( circ );

如何在 Three.js 中构造虚线圆?

最佳答案

删除中心顶点后,您必须计算顶点之间的距离:

circGeom.computeLineDistances();
circGeom.vertices.shift();

=>

circGeom.vertices.shift();
circGeom.computeLineDistances();

[https://jsfiddle.net/fs904hon/ ]

关于javascript - 三.js虚线圆,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37381958/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com