1.7.8 • Published 2 years ago

tarumae-viewer v1.7.8

Weekly downloads
35
License
MIT
Repository
github
Last release
2 years ago

npm

Tarumae

Tarumae is optimized WebGL engine for showcase application. Tarumae-viewer is the web viewer of tarumae engine using WebGL.

Setting up development environment

yarn

Start development environment:

yarn start

Build release

yarn pub

All files published as npm package content are located in dist folder.

Use Tarumae-Viewer

Hello World

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:

cube.mat = {};
// 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

// texture
renderer.createTextureFromURL("/public/mytex.png", tex => {
  cube.mat.tex = tex;
});

// normalmap
renderer.createTextureFromURL("/public/mynormalmap.png", tex => {
  cube.mat.normalmap = tex;
});
1.7.8

2 years ago

1.7.7

3 years ago

1.7.6

3 years ago

1.7.4

3 years ago

1.7.3

3 years ago

1.7.2

4 years ago

1.7.1

4 years ago

1.7.0

4 years ago

1.6.5

4 years ago

1.6.4

4 years ago

1.6.3

4 years ago

1.6.2

4 years ago

1.6.1

4 years ago

1.6.0

4 years ago

1.5.8

4 years ago

1.5.7

4 years ago

1.5.6

4 years ago

1.5.5

4 years ago

1.5.4

4 years ago

1.5.3

4 years ago

1.5.2

4 years ago

1.5.1

4 years ago

1.5.0

4 years ago

1.4.12

4 years ago

1.4.11

4 years ago

1.4.10

5 years ago

1.4.9

5 years ago

1.4.8

5 years ago

1.4.7

5 years ago

1.4.6

5 years ago

1.4.5

5 years ago

1.4.4

5 years ago

1.4.3

5 years ago

1.4.2

5 years ago

1.4.1

5 years ago

1.4.0

5 years ago