react-three-fiber react-three-fiber

Basic sphere

A basic sphere geometry. Fork on Codesandbox

Live example


Coming Soon

Code

import React from "react";
import { render } from "react-dom";
import { Canvas } from "react-three-fiber";

const Sphere = () => {
  return (
    <mesh>
      <sphereBufferGeometry args={[5, 24, 24]} />
      <meshStandardMaterial color={"blue"} />
    </mesh>
  );
};

const App = () => {
  return (
    <Canvas
      style=
      camera=
    >
      <pointLight position={[15, 15, 15]} />
      <Sphere />
    </Canvas>
  );
};

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/basic-sphere
$ npm install && npm run start