# tarumae-viewer

> Optimized WebGL engine for showcase application

Latest version **1.7.8** (published 2022-02-16) · MIT license · 0 weekly downloads

## Install

```sh
npm install tarumae-viewer
pnpm add tarumae-viewer
yarn add tarumae-viewer
bun add tarumae-viewer
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.7.8 |
| Published | 2022-02-16 |
| First published | 2019-07-06 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 4 |
| Unpacked size | 690.4 KB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 11 |
| Author | Jingwood |
| Maintainers | jingwood |

## Links

- npm: https://www.npmjs.com/package/tarumae-viewer
- Repository: https://github.com/bulbinc/tarumae-viewer
- Homepage: https://tarumae.tech
- Issues: https://github.com/bulbinc/tarumae-viewer/issues
- npm.io page: https://npm.io/package/tarumae-viewer

## Dependencies (4)

- [pako](https://npm.io/package/pako.md) ^1.0.6
- [is-svg](https://npm.io/package/is-svg.md) 4.2.2
- [@babel/runtime](https://npm.io/package/@babel/runtime.md) ^7.9.2
- [@jingwood/graphics-math](https://npm.io/package/@jingwood/graphics-math.md) ^1.1.18

## Recent versions

- 1.7.8 (latest) — 2022-02-16
- 1.7.7 — 2021-04-30
- 1.7.6 — 2021-04-23
- 1.7.4 — 2021-01-05
- 1.7.3 — 2020-12-09
- 1.7.2 — 2020-08-11
- 1.7.1 — 2020-07-28
- 1.7.0 — 2020-06-10
- 1.6.5 — 2020-06-03
- 1.6.4 — 2020-05-27
- 1.6.3 — 2020-05-21
- 1.6.2 — 2020-05-06
- 1.6.1 — 2020-04-22
- 1.6.0 — 2020-04-20
- 1.5.8 — 2020-04-16
- … 21 more at https://npm.io/package/tarumae-viewer/versions

## README

![npm](https://img.shields.io/npm/v/tarumae-viewer.svg)

# Tarumae

Tarumae is optimized WebGL engine for showcase application. 
Tarumae-viewer is the web viewer of tarumae engine using WebGL.

# Setting up development environment

```shell
yarn
```

Start development environment:

```shell
yarn start
```

# Build release

```shell
yarn pub
```

All files published as npm package content are located in `dist` folder.

# Use Tarumae-Viewer

## Hello World

```js
import Tarumae from "tarumae";
import { Vec3, Color3 } from "@jingwood/graphics-math";

// create rendering context
const renderer = new Tarumae.Renderer();

// create scene
const scene = renderer.createScene();

// create a cube object
const cube = new Tarumae.Shapes.Cube();

// add cube into scene
scene.add(cube);

// show the scene (begin rendering) 
scene.show();
```

## Set material

Initialize material object:

```js
cube.mat = {};
```

```js
// color
cube.mat.color = new Color3(1, 0, 0); // red (0 ~ 1)

// glossy (mirror reflection)
cube.mat.glossy = 0.7; // (0 ~ 1)

```

### Set resources via async download

```js

// texture
renderer.createTextureFromURL("/public/mytex.png", tex => {
  cube.mat.tex = tex;
});

// normalmap
renderer.createTextureFromURL("/public/mynormalmap.png", tex => {
  cube.mat.normalmap = tex;
});
```

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