https://github.com/danielesteban/sculpty
https://github.com/danielesteban/sculpty
Last synced: about 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/danielesteban/sculpty
- Owner: danielesteban
- License: mit
- Created: 2023-01-29T01:30:17.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2023-01-31T07:52:00.000Z (over 3 years ago)
- Last Synced: 2025-06-18T13:57:46.958Z (about 1 year ago)
- Language: TypeScript
- Homepage: https://sculpty.gatunes.com
- Size: 1.66 MB
- Stars: 13
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[sculpty](https://github.com/danielesteban/sculpty)
[](https://www.npmjs.com/package/sculpty)
==
### Installation
```bash
npm install sculpty
```
### Basic usage
```js
import { World } from 'sculpty';
import { PerspectiveCamera, Scene, sRGBEncoding, WebGLRenderer } from 'three';
const aspect = window.innerWidth / window.innerHeight;
const camera = new PerspectiveCamera(75, aspect, 0.1, 1000);
const renderer = new WebGLRenderer({ antialias: true });
renderer.outputEncoding = sRGBEncoding;
renderer.setSize(window.innerWidth, window.innerHeight);
document.getElementById('renderer').appendChild(renderer.domElement);
const scene = new Scene();
const world = new World();
world.update(Array.from({ length: 20 }, (_, i) => ({
x: i - 10, y: Math.floor(Math.sin(i * 0.5) * 2), z: -10,
r: 255, g: 255, b: 255,
value: 255,
})));
scene.add(world);
renderer.setAnimationLoop(() => {
renderer.render(scene, camera);
});
```
### Examples
* Basic: [sculpty.glitch.me](https://sculpty.glitch.me) ([source](https://glitch.com/edit/#!/sculpty))
* Editor: [sculpty.gatunes.com](https://sculpty.gatunes.com) ([source](example))