0.0.9 • Published 11 months ago

three-extruded-image v0.0.9

Weekly downloads
-
License
-
Repository
-
Last release
11 months ago

three-extruded-image

View it here!!

Given a transparent background *.png, construct a ThreeJS mesh of that image, extruded.

NPM Version

npm.io

!NOTE This library is in serving of Voxelize, a fullstack voxel engine. Although basic needs is met, there is still some work needed to make it perfect, any PRs are welcomed!

Installation

pnpm install three-extruded-image

Usage

import { ExtrudedImage, type ExtrudedImageOptions } from 'three-extruded-image';

const options: ExtrudedImageOptions = {
  thickness: 0.3,
  size: 3,
  alphaThreshold: 128,
};
const extrudedImage = new ExtrudedImage(image, options);

scene.add(extrudedImage);
OptionTypeDescription
thicknessnumberThe depth of the extrusion
sizenumberThe overall size of the extruded image
alphaThresholdnumberThe alpha value threshold for determining transparency
materialParams?objectAdditional material parameters
materialParams.color?THREE.ColorRepresentationThe color of the material
customMaterial?THREE.MeshBasicMaterial | THREE.MeshStandardMaterialCustom material to override default material

Development

git clone git@github.com:shaoruu/three-extruded-image.git

cd three-extruded-image
pnpm install

pnpm dev

# visit http://localhost:5173

Shoutout to @manthrax for the help!

0.0.9

11 months ago

0.0.8

11 months ago

0.0.7

12 months ago

0.0.6

12 months ago

0.0.5

12 months ago

0.0.4

12 months ago

0.0.3

12 months ago

0.0.2

12 months ago

0.0.1

12 months ago