Relative Content

Tag Archive for three.jsreact-three-fiberreact-three-drei

Manually update 3D Object pivot point in three JS

I’m quite new to ThreeJS and I just got this car model on Sketchfab, but when i try to put it in my React Three Fiber app it display very far away in the scene, when I attempt to rotating it follow the Y axis cause the object float around instead rotating around the axis. I put it in Threejs Editor and turn out the pivot point is outside the car instead in the middle of the model.

Three.js outlinePass add-on not working when implemented with R3F

I’m having a hard time using the R3F -postprocessing library so I decided to use raw threejs classes:
By diving into the R3F extending third party library tutorials I managed to setup the renderPass and the outlinePass with typescript https://docs.pmnd.rs/react-three-fiber/tutorials/typescript

How to keep a react three fiber canvas from scaling an object when resizing browser and always render object the same size?

I am using react fiber in one of our projects but the issue I am facing is that the GLB object gets scaled when resizing the browser or is adjusted depending on the browser’s size. For example: MS Edge has less page real-estate than chrome, so it renders smaller already on page load. The model is sticky, overlaying content, for animation purposes.
I have no idea how to fix this actually. Could someone maybe help me out with the math or is there another Drei helper I could use? All help would be appreciated!