react-three-fiber react-three-fiber react-three-fiber

Rounded box

Drei’s rounded box geometry. Fork on Codesandbox

Live example


Coming Soon

Code

import React from "react";
import ReactDOM from "react-dom";
import { Canvas } from "react-three-fiber";
import { OrbitControls, Stats, RoundedBox } from "@react-three/drei";
import "./styles.css";

const App = () => {
  return (
    <Canvas style=>
      <pointLight position={[5, 5, 5]} />
      <RoundedBox args={[3, 3, 0.25]} radius={0.1}>
        <meshLambertMaterial attach="material" color={"grey"} />
      </RoundedBox>
      <OrbitControls />
      <Stats />
    </Canvas>
  );
};

ReactDOM.render(<App />, document.getElementById("root"));

Running this example

Clone this repo, and then NPM install and NPM start from the relevant directory.

$ cd examples/geometry/rounded-box
$ npm install && npm run start