From 809e230e2a6a2e586df8788946fe98be81459361 Mon Sep 17 00:00:00 2001 From: luxiaotao1123 <t1341870251@63.com> Date: 星期五, 17 十二月 2021 16:10:23 +0800 Subject: [PATCH] # --- static/js/object/StoreCrn.js | 25 +++++++++++++++++++++++++ 1 files changed, 25 insertions(+), 0 deletions(-) diff --git a/static/js/object/StoreCrn.js b/static/js/object/StoreCrn.js index f7751a3..17c4c22 100644 --- a/static/js/object/StoreCrn.js +++ b/static/js/object/StoreCrn.js @@ -1,5 +1,6 @@ import {MTLLoader} from "../lib/MTLLoader.js"; import {OBJLoader} from "../lib/OBJLoader.js"; +import {Color} from "../three.module.js"; const xOffset = -1735; const yOffset = -289; @@ -69,6 +70,14 @@ .setMaterials( materials ) .setPath( '../static/model/obj/' ) .load( '鍫嗗灈鏈烘湰浣�.obj', function ( obj ) { + obj.traverse (function (child) { + if (child instanceof THREE.Mesh) { + child.material = new THREE.MeshLambertMaterial({ + color: 0xCD6839 + }); + } + }); + obj.scale.set(0.03, 0.03, 0.03); obj.rotateY(- Math.PI / 2); obj.name = option.crnNo + "-body"; @@ -86,6 +95,14 @@ .setMaterials( materials ) .setPath( '../static/model/obj/' ) .load( '杞借揣鍙�.obj', function ( obj ) { + obj.traverse (function (child) { + if (child instanceof THREE.Mesh) { + child.material = new THREE.MeshLambertMaterial({ + color: 0xD2691E + }); + } + }); + obj.scale.set(0.03, 0.03, 0.03); obj.rotateY(- Math.PI / 2); obj.name = option.crnNo + "-load"; @@ -103,6 +120,14 @@ .setMaterials( materials ) .setPath( '../static/model/obj/' ) .load( '璐у弶.obj', function ( obj ) { + obj.traverse (function (child) { + if (child instanceof THREE.Mesh) { + child.material = new THREE.MeshLambertMaterial({ + color: 0x363636 + }); + } + }); + obj.scale.set(0.03, 0.03, 0.03); obj.rotateY(- Math.PI / 2); obj.name = option.crnNo + "-fork"; -- Gitblit v1.9.1