Questions tagged [react-three-fiber]

Questions about React-three-fiber, a React renderer for Three.js.

Filter by
Sorted by
Tagged with
0
votes
0answers
8 views

React Three- Code a 3rd person view camera

I'm trying to set dynamic camera position behind the car implemented in a project similar to CAR using raycastVehicle I tried to change camera's position using state/hooks, but I am unable locate car'...
0
votes
0answers
14 views

Three Js React how to have mesh refract it's environment but hide the environment background to the camera

I have been trying to solve this for a while, so any help would be greatly appreciated! What I am trying to do is give the appearance that an image is trapped within a mesh. The thought I had to do ...
0
votes
0answers
9 views

How to Perform Inplace Animations in React Three Fiber

I imported a 3D model from Mixamo with some animations and was wondering how to perform does animations in place? The GLTF file I created from npx gltfjsx: const { nodes, materials, animations } = ...
-2
votes
0answers
12 views

ThreeJS - must explicitly specify all locations when using multiple fragment outputs

I'm making a custom ShaderMaterial with react-three-fiber. I made this simple shader: const shaderArgs = useMemo( () => ({ uniforms: { uTime: { value: 0 }, }, ...
0
votes
0answers
7 views

react-postprocessing outline affecting the scene's lighting

I have a simple piece of code that's conditionally applying an outline effect. {highlight ? ( <EffectComposer multisampling={8} autoClear={false}> <Outline ...
1
vote
0answers
22 views

React Three Fiber mouse Polling

I'm using react three fiber, and would like to update some position when moving the mouse: const Sphere = (props) => { const [curPos, setCurPos] = useState<Vector3>(); return ( <...
0
votes
1answer
28 views

Run React's useEffect at random intervals

I am new to React and ThreeJs. I am using react-three-fiber to animate a 3d model. I have generated a React component that uses `useEffect to trigger some animations. This code runs in an infinite ...
2
votes
0answers
18 views

Properly destroying a 3D object (React Three Fiber), its meshes, animations and all

How do I destroy the whole three object, along with its animation and all I have a glb file (created with Blender and exported to gltf 2.0) Then I mount it to react with (and react Three Fiber) const {...
1
vote
0answers
16 views

Using Lookat in @react-three/fiber and @react-three/drei

I am trying learn how to use three js with react.For this purpose I am using @react-three/fiber and @react-three/drei. This project by chriscourses was what I used to learn three js and I hope to use ...
0
votes
1answer
9 views

How to get OrbitControls ref

I am trying to access OrbitControls ref as follow: const controlsRef = useRef<any>(); return ( <> <Canvas camera={{ position: [0, 0, 100], up: [...
0
votes
1answer
20 views

How to pan the camera by code in react-three/fiber and react-three/drei

I can pan the the camera from default position [0,0,0] to [100,100,0] using the mouse with OrbitControls. However still fail to do the panning by code. <Canvas camera={{ position: ...
0
votes
0answers
30 views

How to activate PointerLockControls only when clicking a button?

I am using the "PointerLockControls" class and I would like to be able to disable the mouse lock when I am in my menu. I want the only way to lock the mouse is to press the button for that. ...
0
votes
2answers
29 views

how to get the world coordinates from mouse coordinates in threejs

I am trying to convert from mouse position to map position in react-threejs. Using hook useThree I can get the mouse position where x,y in [-1,1]. However unproject(camera) returns the values in [-...
0
votes
1answer
28 views

Same material different opacity

I have thousands of meshes with identical material, but with different opacity. Is there a way to reuse the material among them?
0
votes
1answer
29 views

How to pass multiple textures into one mesh in react-three-fiber?

Using React-three-fiber, I’m trying to build out a carousel made of plane geometries that I intend to animate. I’m having a bit of trouble figuring out how to pass multiple textures inside my basic ...

15 30 50 per page
1
2 3 4 5
28