21 lines
682 B
TypeScript
21 lines
682 B
TypeScript
import { MeshBasicMaterial, Color, LineBasicMaterial } from "three";
|
|
|
|
//板件的材质,使用这个材质避免板件将线覆盖.
|
|
export let boardMaterial = new MeshBasicMaterial({
|
|
color: new Color(0.8, 0.8, 0.8),
|
|
polygonOffset: true,
|
|
polygonOffsetFactor: 1, // positive value pushes polygon further away
|
|
polygonOffsetUnits: 1
|
|
});
|
|
|
|
export let selectMaterial = new MeshBasicMaterial({
|
|
color: new Color(0.1, 0.5, 0.5),
|
|
polygonOffset: true,
|
|
polygonOffsetFactor: 1, // positive value pushes polygon further away
|
|
polygonOffsetUnits: 1
|
|
});
|
|
|
|
//线框的材质
|
|
export let edgeMaterial = new LineBasicMaterial({ linewidth: 2, color: new Color(0, 0, 0) });
|
|
|