too tired for this shit object3d is not instance of mesh wtf
This commit is contained in:
File diff suppressed because one or more lines are too long
2
dist/index.html
vendored
2
dist/index.html
vendored
@@ -11,7 +11,7 @@
|
|||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<script type="module" crossorigin src="/assets/index-Co9VroNa.js"></script>
|
<script type="module" crossorigin src="/assets/index-C_ucNTj8.js"></script>
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
|
12
main.js
12
main.js
@@ -23,6 +23,18 @@ const objectLoader = new OBJLoader();
|
|||||||
objectLoader.load(
|
objectLoader.load(
|
||||||
headURL,
|
headURL,
|
||||||
function(object) {
|
function(object) {
|
||||||
|
console.log(object);
|
||||||
|
|
||||||
|
scene.traverse((object) => {
|
||||||
|
if (object instanceof THREE.Mesh) {
|
||||||
|
console.log('is instance of mesh');
|
||||||
|
object.material = new THREE.MeshStandardMaterial({color: 0x962FFE});
|
||||||
|
object.material.wireframe = true;
|
||||||
|
} else {
|
||||||
|
console.log('not instance of mesh');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
scene.add(object);
|
scene.add(object);
|
||||||
},
|
},
|
||||||
function(xhr) {
|
function(xhr) {
|
||||||
|
Reference in New Issue
Block a user