mirror of
https://github.com/xibyte/jsketcher
synced 2025-12-06 08:25:19 +01:00
22 lines
No EOL
526 B
JavaScript
22 lines
No EOL
526 B
JavaScript
import DPR from 'dpr';
|
|
import {MeshPhongMaterial, LineBasicMaterial, FaceColors, DoubleSide} from 'three';
|
|
|
|
export function createTransparentPhongMaterial(color, opacity) {
|
|
return new MeshPhongMaterial({
|
|
// vertexColors: FaceColors,
|
|
color,
|
|
transparent: true,
|
|
opacity: opacity,
|
|
shininess: 0,
|
|
depthWrite: false,
|
|
depthTest: false,
|
|
side : DoubleSide
|
|
});
|
|
}
|
|
|
|
export function createLineMaterial(color, linewidth) {
|
|
return new LineBasicMaterial({
|
|
color,
|
|
linewidth: linewidth / DPR
|
|
});
|
|
} |