too tired for this shit object3d is not instance of mesh wtf

This commit is contained in:
CJSatnarine
2025-02-28 21:17:04 -05:00
parent 466115060a
commit 04b036dbc9
3 changed files with 182 additions and 170 deletions

File diff suppressed because one or more lines are too long

2
dist/index.html vendored
View File

@@ -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
View File

@@ -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) {