three.cad/src/sketchAxes.js

36 lines
909 B
JavaScript
Raw Normal View History

2021-04-06 18:31:14 +00:00
// import { LineSegments } from '../objects/LineSegments.js';
// import { LineBasicMaterial } from '../materials/LineBasicMaterial.js';
// import { Float32BufferAttribute } from '../core/BufferAttribute.js';
// import { BufferGeometry } from '../core/BufferGeometry.js';
2021-04-06 19:46:16 +00:00
import { LineSegments, LineBasicMaterial, Float32BufferAttribute, BufferGeometry } from '../node_modules/three/src/Three'
2021-04-06 18:31:14 +00:00
2021-04-08 07:33:18 +00:00
2021-04-06 18:31:14 +00:00
class AxesHelper extends LineSegments {
constructor(s = 1) {
const vertices = [
0, 0, 0, 0.5 * s, 0, 0,
2021-04-08 04:05:54 +00:00
0.5 * s, 0, 0, 0.3 * s, 0.08*s, 0,
2021-04-06 18:31:14 +00:00
0, 0, 0, 0, s, 0,
];
const geometry = new BufferGeometry();
geometry.setAttribute('position', new Float32BufferAttribute(vertices, 3));
2021-04-08 07:33:18 +00:00
const material = new LineBasicMaterial({ color: 0xff0000, toneMapped: false, linewidth:5 });
2021-04-06 18:31:14 +00:00
super(geometry, material);
// this.type = 'AxesHelper';
}
}
export { AxesHelper };