mirror of
https://github.com/Doodle3D/Doodle3D-Core.git
synced 2024-12-22 19:13:49 +01:00
fix material index
This commit is contained in:
parent
01f4b4c1f8
commit
0c4e410a27
@ -98,11 +98,11 @@ export function generateExportMesh(state, options = {}) {
|
|||||||
objectGeometry.mergeVertices();
|
objectGeometry.mergeVertices();
|
||||||
objectGeometry.applyMatrix(new THREE.Matrix4().multiplyMatrices(objectMatrix, matrix));
|
objectGeometry.applyMatrix(new THREE.Matrix4().multiplyMatrices(objectMatrix, matrix));
|
||||||
|
|
||||||
|
const materialIndex = materials.length;
|
||||||
const exportMaterial = new THREE.MeshBasicMaterial({ color: material.color.getHex() });
|
const exportMaterial = new THREE.MeshBasicMaterial({ color: material.color.getHex() });
|
||||||
exportMaterial.side = shapeData.fill ? THREE.FrontSide : THREE.DoubleSide;
|
exportMaterial.side = shapeData.fill ? THREE.FrontSide : THREE.DoubleSide;
|
||||||
materials.push(exportMaterial);
|
materials.push(exportMaterial);
|
||||||
|
|
||||||
const materialIndex = materials.length;
|
|
||||||
if (unionGeometry) {
|
if (unionGeometry) {
|
||||||
objectGeometry = new THREE_BSP(objectGeometry, materialIndex);
|
objectGeometry = new THREE_BSP(objectGeometry, materialIndex);
|
||||||
if (exportGeometry) {
|
if (exportGeometry) {
|
||||||
|
Loading…
Reference in New Issue
Block a user