1

I'm trying to add MeshPhongMaterial to my model but it's not working, I need shininess to the center of the model and it moves with the rotation of the object

const materials = useLoader(MTLLoader, ob[1].mtl)
  materials.preload()
  let object = useLoader(OBJLoader, ob[1].obj, loader => {
  loader.setMaterials(materials)
  })
  const {y}=useControls("Light",{y:{value:20,step:0.2}})
  const {x}=useControls("Light",{x:{value:0,step:0.2}})
  const {z}=useControls("Light",{z:{value:100,step:0.2}})
  const {specular,shininess}=useControls({specular:"#fff",shininess:50})
return (
<Canvas style={{"marginTop":"20vh",height:"400px"}}>
<ambientLight intensity={0.25} />
  <pointLight  position={[x,y,z]} intensity={0.3}/>
  <pointLight position={[x,y,-80]} intensity={0.3}/>
  <OrbitControls  maxDistance={90} />
  <meshPhongMaterial  shininess={shininess} specular={specular}/>
  <mesh >
  <primitive object={object}   />
  </mesh>
  </Canvas>
Zein
  • 571
  • 4
  • 24

0 Answers0