#I need help with this
8 messages · Page 1 of 1 (latest)
is it something that has to do with RandomizedLight in this file
import React, { useRef } from 'react';
import { easing } from 'maath';
import { useFrame } from '@react-three/fiber';
import { AccumulativeShadows, RandomizedLight } from '@react-three/drei';
const Backdrop = () => {
const shadows = useRef();
return (
<AccumulativeShadows
ref={shadows}
temporalFrames={60}
alphaTest={0.82}
scale={10}
rotation={[Math.PI / 2, 0, 0]}
position={[0, 0, -0.14]}
>
<RandomizedLight
amount={4}
radius={9}
intensity={0.55}
ambient={0.25}
position={[0, 5, -10]}
/>
<RandomizedLight
amount={4}
radius={5}
intensity={0.25}
ambient={0.55}
position={[-5, 5, -9]}
/>
</AccumulativeShadows>
);
};
export { Backdrop };
or Camera settings
import React, { useRef } from 'react';
import { useFrame } from '@react-three/fiber';
import {easing } from 'maath';
import { useSnapshot } from 'valtio';
import state from '../Store';
const CameraRig = ( {children} ) => {
const group = useRef();
const snap = useSnapshot(state);
useFrame(( state,delta) => {
const isBreakpont = window.innerWidth <= 1260;
const isMobile = window.innerWidth <= 600;
let targerPostition = [-0.4,0,0.2];
if(snap.intro){
if(isBreakpont) targerPostition = [0, 0, 2];
if(isMobile) targerPostition = [0, 0.2, 2.5];
} else {
if(isMobile) targerPostition = [0, 0, 2.5];
else targerPostition = [0, 0, 2];
}
easing.damp3(state.camera.position, targerPostition, 0.25, delta);
easing.dampE(
group.current.position,[state.pointer.y / 10, state.pointer.x / 5, 0],0.25,delta
)
})
return <group ref={group}>{children}</group>
}
export {CameraRig};
are the normals ok? are they reversed?
the original sandbox is this one if you want to cross check https://codesandbox.io/s/t-shirt-configurator-ioxywi
I actually edited it to be able to rotate so users can have interactive experience like in AR
Well, it generates a shadow, it’s black underneath that model. You can remove the shadow altogether