1.7.8 • Published 3 years ago

tarumae-viewer v1.7.8

Weekly downloads
35
License
MIT
Repository
github
Last release
3 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

3 years ago

1.7.7

4 years ago

1.7.6

4 years ago

1.7.4

4 years ago

1.7.3

5 years ago

1.7.2

5 years ago

1.7.1

5 years ago

1.7.0

5 years ago

1.6.5

5 years ago

1.6.4

5 years ago

1.6.3

5 years ago

1.6.2

5 years ago

1.6.1

5 years ago

1.6.0

5 years ago

1.5.8

5 years ago

1.5.7

5 years ago

1.5.6

5 years ago

1.5.5

5 years ago

1.5.4

5 years ago

1.5.3

5 years ago

1.5.2

5 years ago

1.5.1

5 years ago

1.5.0

5 years ago

1.4.12

5 years ago

1.4.11

5 years ago

1.4.10

6 years ago

1.4.9

6 years ago

1.4.8

6 years ago

1.4.7

6 years ago

1.4.6

6 years ago

1.4.5

6 years ago

1.4.4

6 years ago

1.4.3

6 years ago

1.4.2

6 years ago

1.4.1

6 years ago

1.4.0

6 years ago