Make shadow behind the model #2750
RevylaV
started this conversation in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi, i'm new to Three js, I created a react three fiber component that renders my 3D model, currently my model casts shadows that i can see behind my model, but when i move the camera shadow are moving too and at some points in my canvas "Box" there are no place for shadow (my box size is limited and it should be this size), so when i move the camera for example to the left shadow is cut by the box, that doesn't look good, the idea is to make shadow remain behind the model no mater where i will rotate my camera, but for now i have no idea how to implement that, please give me some advice, is it possibly to fix shadows at the scene no mater of camera movement??
Here is an example of my code
import React from 'react';
import { Canvas } from '@react-three/fiber';
import {
useGLTF,
OrbitControls,
ContactShadows,
Environment,
} from '@react-three/drei';
const Model = ({ url }) => {
const model = useGLTF(url);
return (
<ContactShadows position={[0.1, -2.5, 0.5]} scale={20} blur={1} far={4.5} />
);
};
const TestModel = () => (
<OrbitControls
enableZoom={false}
minPolarAngle={Math.PI / 8}
maxPolarAngle={Math.PI / 0}
/>
);
export default TestModel;
Beta Was this translation helpful? Give feedback.
All reactions