react-threejs

0.0.4 • Public • Published

react-threejs

WIP: Simplest bindings between React & Three.js

http://fritx.github.io/react-threejs/example/

See also: vue-threejs

import React, { Component } from 'react'
import { Renderer, Camera, Scene } from 'react-threejs'
render () {
  return (<Renderer size={rendererSize}>
    <Camera position={{ z: 5 }} />
    <Scene>
      <MyCube color={0x00ff00} rotation={rotation}>
        <MyCube color={0xff0000} position={{ y: 2 }} />
        <MyCube color={0x0000ff} position={{ z: 3 }} />
      </MyCube>
    </Scene>
  </Renderer>)
}
// setting FirstPersonControls, PositionalAudio & more
render () {
  return (<Renderer size={rendererSize}>
    <Scene>
      <FirstPersonControls>
        <AudioListener />
        <Camera />
      </FirstPersonControls>
      <Mesh rotation={rotation} geometry={geometry} material={material}>
        <PositionalAudio url="Project_Utopia.ogg" />
      </Mesh>
    </Scene>
  </Renderer>)
}

/react-threejs/

    Package Sidebar

    Install

    npm i react-threejs

    Weekly Downloads

    25

    Version

    0.0.4

    License

    none

    Unpacked Size

    227 kB

    Total Files

    39

    Last publish

    Collaborators

    • fritx