-
What is better?
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
scale is better because args re-construct the object from scratch: <boxGeometry args={[1, 2, 3]} /> is the same as writing const box1 = new THREE.BoxGeometry(1, 2, 3) scale on the other hand just stretches the object, and in a cubes case that's the same as providing args. btw boxBufferGeometry is deprecated. everything is now just [name]Geometry and it's buffergeometry as the only remaining geometry type in three. |
Beta Was this translation helpful? Give feedback.
-
Hey @drcmda is it not possible to scale geometry in react/three? eg..
in plain three for example we can do...
i tried applying scale in geometry props which doesn't work as well as using a ref on geometry to try scaling in a useEffect but the function "scale doesn't exist", is this correct or am i missing something? being able to scale and rotate geometry independently of its mesh is crucial in some use cases... |
Beta Was this translation helpful? Give feedback.
scale is better because args re-construct the object from scratch:
is the same as writing
scale on the other hand just stretches the object, and in a cubes case that's the same as providing args.
btw boxBufferGeometry is deprecated. everything is now just [name]Geometry and it's buffergeometry as the only remaining geometry type in three.