Replies: 1 comment 1 reply
-
fiber is just a renderer, you're still using plain threejs. but sure, three has a function for that: function Upper() {
const geomUpper = useLoader(STLLoader, upperUrl)
useLayoutEffect(() => {
const box = new THREE.Box3()
box.expandByObject(geomUpper)
const size = box.getSize(new THREE.Vector3())
// ...
}, [])
return <primitive object={geomUpper} /> |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Is there a way to get the size of an object loaded by the STL loader?
I loaded an object using the STL loader and want to get the size of it to resize another object in relation to the original's size.
const geomUpper = useLoader(STLLoader, upperUrl)
Is there a way to get the size of geomUpper using only react-three-fiber? Or do I need to use Three.js itself for that?
Beta Was this translation helpful? Give feedback.
All reactions