react-bim

A helper library that provides 3D BIM component based on react-three-fiber. May be merged into epics-components in the future. Beware of the peer deps.

Usage no npm install needed!

<script type="module">
  import reactBim from 'https://cdn.skypack.dev/react-bim';
</script>

README

React BIM

A helper library that provides 3D BIM component based on react-three-fiber. May be merged into epics-components in the future. Beware of the peer deps.

Author

onichandame

Usage

import React, { FC, useState, useEffect } from 'react'
import { Canvas, Model } from 'react-bim'

const App: FC = () => {
  const [ status, setStatus ] = useState<'normal'|'error'>()
  useEffect(() => setInterval(() => setStatus(status === 'normal' ? 'error' : 'normal'), 1000), [])
  return (
    <Canvas>
      <Model
        src={{
          normal: '/normal.glb',
          error: '/error.glb'
        }}
        status={status}
      />
    </Canvas>
  )
}