Three.js react drei 同一个立方体如何给不同的面设置材质

190 阅读1分钟
  <mesh>
        <boxGeometry args={[40, 10, 10]} />
        {/* 右边 */}
        <meshStandardMaterial attach="material-0" color="red"  />
        {/* 左边 */}
        <meshStandardMaterial attach="material-1" color="gold" />
        {/* 上边 */}
        <meshStandardMaterial attach="material-2" color="pink"  />
        {/* 下边 */}
        <meshStandardMaterial attach="material-3" color="green"  />
        {/* 前边 */}
        <meshStandardMaterial attach="material-4" color="blue" />
        {/* 后边 */}
        <meshStandardMaterial attach="material-5" color="purple" />
   </mesh>