update readme
This commit is contained in:
parent
5c2bcacf7c
commit
7114f93c7c
20
README.md
20
README.md
|
@ -38,12 +38,18 @@ Three.js powered Minecraft skin viewer.
|
||||||
// Load a cape
|
// Load a cape
|
||||||
skinViewer.loadCape("img/cape.png");
|
skinViewer.loadCape("img/cape.png");
|
||||||
|
|
||||||
// Load a elytra (from a cape texture)
|
// Load an elytra (from a cape texture)
|
||||||
skinViewer.loadCape("img/cape.png", { backEquipment: "elytra" });
|
skinViewer.loadCape("img/cape.png", { backEquipment: "elytra" });
|
||||||
|
|
||||||
// Unload(hide) the cape / elytra
|
// Unload(hide) the cape / elytra
|
||||||
skinViewer.loadCape(null);
|
skinViewer.loadCape(null);
|
||||||
|
|
||||||
|
// Set the background color
|
||||||
|
skinViewer.background = 0x5a76f3;
|
||||||
|
|
||||||
|
// Set the background to a panoramic image!
|
||||||
|
skinViewer.loadPanorama("img/panorama1.png");
|
||||||
|
|
||||||
// Control objects with your mouse!
|
// Control objects with your mouse!
|
||||||
let control = skinview3d.createOrbitControls(skinViewer);
|
let control = skinview3d.createOrbitControls(skinViewer);
|
||||||
control.enableRotate = true;
|
control.enableRotate = true;
|
||||||
|
@ -74,16 +80,8 @@ Three.js powered Minecraft skin viewer.
|
||||||
skinview3d supports FXAA (fast approximate anti-aliasing).
|
skinview3d supports FXAA (fast approximate anti-aliasing).
|
||||||
To enable it, you need to replace `SkinViewer` with `FXAASkinViewer`.
|
To enable it, you need to replace `SkinViewer` with `FXAASkinViewer`.
|
||||||
|
|
||||||
You must use an **opaque** background when FXAA is enabled,
|
Note that FXAA is incompatible with transparent backgrounds.
|
||||||
because FXAA is incompatible with transparent backgrounds.
|
So when FXAA is enabled, the default background color will be white instead of transparent.
|
||||||
|
|
||||||
By default, when FXAA is enabled, the background color is white.
|
|
||||||
To use a different color:
|
|
||||||
```javascript
|
|
||||||
let skinViewer = new skinview3d.FXAASkinViewer(...);
|
|
||||||
// Set the background color to blue
|
|
||||||
skinViewer.background = 0x5a76f3;
|
|
||||||
```
|
|
||||||
|
|
||||||
# Build
|
# Build
|
||||||
`npm run build`
|
`npm run build`
|
||||||
|
|
Loading…
Reference in New Issue