# @kunhuang09/react3d

> a small javascript library to glue Threejs and Reactjs

Latest version **0.1.1** (published 2018-08-05) · ISC license · 0 weekly downloads

## Install

```sh
npm install @kunhuang09/react3d
pnpm add @kunhuang09/react3d
yarn add @kunhuang09/react3d
bun add @kunhuang09/react3d
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.1 |
| Published | 2018-08-05 |
| First published | 2018-08-03 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 5 |
| Unpacked size | 30.7 KB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 3 |
| Author | K. Huang |
| Maintainers | kunhuang09 |
| Keywords | threejs, react |

## Links

- npm: https://www.npmjs.com/package/@kunhuang09/react3d
- Repository: https://github.com/hku/react3d
- Homepage: https://github.com/hku/react3d#readme
- Issues: https://github.com/hku/react3d/issues
- npm.io page: https://npm.io/package/@kunhuang09/react3d

## Dependencies (5)

- [react](https://npm.io/package/react.md) ^15.2.1
- [three](https://npm.io/package/three.md) ^0.87.0
- [tween](https://npm.io/package/tween.md) ^0.9.0
- [react-dom](https://npm.io/package/react-dom.md) ^15.2.1
- [three-orbitcontrols](https://npm.io/package/three-orbitcontrols.md) ^2.1.2

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 0.1.1 (latest) — 2018-08-05
- 0.1.0 — 2018-08-03

## README

# react3d

a light javascript library to glue threejs and reactjs

- [examples](https://github.com/hku/react3d-examples.git) 
- [blog](https://hku.github.io/articles/react3d/)

## Installation

Using npm

```
npm i @kunhuang09/react3d
```

In javascript

```
import {Scene, Camera, PointLight, Object3D, OrbitControls, Tween} from "@kunhuang09/react3d"
```

## Demo

Here is a simple demo：

![demo](https://hku.github.io//articles/react3d/img/capture.gif)

The corresponding jsx code:

```xml

 <Scene width={width} height={height} style={{display:"block", margin: 0, cursor:"pointer"}}>
	<button onClick= {this.onClickBtn}>tween animation</button>
	<Camera fov={80} aspect={width/height} near={0.1} far={50} z={30}>
		<OrbitControls/>
	</Camera>
	<PointLight y={200}/>
	<PointLight x={100} y={200} z={100}/>
	<PointLight x={-100} y={-200} z={-100}/>
	<Object3D update={obj => {
		obj.rotation.x += 0.005;
		obj.rotation.y += 0.005;
	}}>
		<Cube/>
		<Cube wireframe={true}/>
	</Object3D>
	<Tween data={this.state} view = {v => <Dodecahedron x={v.x} y={v.y}/>}/>
</Scene>

```

---
_Source: https://npm.io/package/@kunhuang09/react3d · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
