I successfully loaded multiple files using the code below for three.js JSONLoader:
<!DOCTYPE html>
<html>
<head>
<title>Rotating Sphere</title>
<meta charset="utf-8">
<!-- https://cdnjs.com/libraries/three.js -->
<script src="http://www.amdesigngroup.com/clients/AM_6292_Learning/js/three.min.js"></script>
<script src="http://www.amdesigngroup.com/clients/AM_6292_Learning/js/OrbitControls.js"></script>
<!-- Tween.js: https://cdnjs.com/libraries/tween.js/ -->
<script src="http://www.amdesigngroup.com/clients/AM_6292_Learning/js/Tween.js"></script>
</head>
<body style="margin: 0; background-color:#6cdbf5;">
<div class="canvas-wrapper">
<canvas id="mycanvas">
</canvas>
</div>
// Code here
</script>
</body>
</html>
Unfortunately, I encountered issues with trying to load two models using the ObjectLoader. It seems like there are errors related to GeometryUtils.center and a.center being undefined. How can I resolve these errors and why are they occurring?
It appears that JSONLoader and ObjectLoader operate differently, leading to compatibility issues in my code. Despite attempting various fixes, I couldn't find helpful information online or in the documentation. Any guidance on rectifying these errors would be greatly appreciated!
Thank you for your assistance!!!
NOTE: Apologies for the messy code - I understand it's not optimized, but currently, functionality is the primary focus. Cleanup will be done later!