improve appearance of lay-flat target
This commit is contained in:
parent
a714a59cbd
commit
a0e9584446
1 changed files with 17 additions and 1 deletions
|
|
@ -1,8 +1,24 @@
|
||||||
kiri.load(function(API) {
|
kiri.load(function(API) {
|
||||||
|
// circle
|
||||||
let pgeo = new THREE.CircleGeometry(8, 30);
|
let pgeo = new THREE.CircleGeometry(8, 30);
|
||||||
let pmat = new THREE.MeshBasicMaterial({color: 0xff0000, opacity: 0.5, transparent: true});
|
let pmat = new THREE.MeshBasicMaterial({color: 0xff0000, opacity: 0.5, transparent: true});
|
||||||
let pmesh = new THREE.Mesh(pgeo, pmat);
|
let pmesh = new THREE.Mesh(pgeo, pmat);
|
||||||
let wgeo = new THREE.WireframeGeometry(pgeo);
|
// circle outline
|
||||||
|
let pi = pgeo.index.array;
|
||||||
|
let pp = pgeo.attributes.position.array;
|
||||||
|
let np = [];
|
||||||
|
for (let i=0; i<pi.length; i++) {
|
||||||
|
if (pi[i] * pi[i+1]) {
|
||||||
|
np.push(pp[pi[i]*3+0]);
|
||||||
|
np.push(pp[pi[i]*3+1]);
|
||||||
|
np.push(pp[pi[i]*3+2]);
|
||||||
|
np.push(pp[pi[i+1]*3+0]);
|
||||||
|
np.push(pp[pi[i+1]*3+1]);
|
||||||
|
np.push(pp[pi[i+1]*3+2]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
let wgeo = new THREE.BufferGeometry();
|
||||||
|
wgeo.setAttribute('position', new THREE.BufferAttribute(np.toFloat32(), 3));
|
||||||
let wmat = new THREE.LineBasicMaterial({ color: 0x883333 });
|
let wmat = new THREE.LineBasicMaterial({ color: 0x883333 });
|
||||||
let wmesh = new THREE.LineSegments(wgeo, wmat);
|
let wmesh = new THREE.LineSegments(wgeo, wmat);
|
||||||
pmesh.add(wmesh);
|
pmesh.add(wmesh);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue