0.2.25 • Published 3 years ago

threejs-objects v0.2.25

Weekly downloads
3
License
MIT
Repository
github
Last release
3 years ago

three.js Objects

A composition of cool 3D accelerated objects.

What is this?

This is an extension library for three.js, which provides some 3D objects ready to use. The main problem I had was to create nice looking objects for my prototypes. Because creating a prototype is about create a basic design fast, the development of 3D objects is a bottleneck and slows down the creation of the prototype.

Which object classes are implemented?

This repository will be continuously updated and extended by new 3D objects. You can find all implemented objects in the list below.

ClassDescription
ParticleWaveA plane, which consists of particles to simulate a wave effect
ParticleImageRandom particles representing pixel colors of an image

How do I use this?

Import an object and add it to the three.js scene. The options argument contains parameters of the object.

import { ParticleWave } from "threejs-objects";

const wave = new ParticleWave(options);
scene.add(wave);

Development

First, fork and clone the project

git clone https://github.com/<your-github-name>/threejs-objects

Install the dependencies

npm install

Build the project

npx rollup -c

Reference

ParticleWave

Options

ParameterTypeDefaultDescription
numberParticlesarray[50, 50]Amount of particles in x and y direction
particleSizenumberArray0.025The size of a particle. Could be either a number or an interval to choose a random size per particle.
particleTexturestringPath to the texture of the particles
waveHeightnumber1.0Amplitude of the wave
noisenumber0.0A value greater than 0 will add noise to the position of each particle
particleColornumber0xeeeeeeThe color of each particle

Example

const wave = new ParticleWave({
  numberParticles: [30, 30],
  particleTexture: "images/circle.png",
  waveHeight: 0.05
});

ParticleImage

Options

ParameterTypeDefaultDescription
imagestringPath to the image file
useImageColorsboolfalseIf the shaders should render the actual pixel colors
amplitudenumber0.05The amplitude of the wave effect
colorColorColor(1.0, 1.0, 1.0)If !useImageColors, this option sets the color of each particle
particleTexturestringPath to the texture of the particles
numberParticlesnumber1000The number of random particles representing the specified image

Example

const image = new ParticleImage({
  useImageColors: true,
  amplitude: 0.1,
  numberParticles: 50000,
  image: "images/profile.png",
  particleTexture: "images/circle.png"
});
0.2.25

3 years ago

0.2.24

3 years ago

0.2.23

3 years ago

0.2.22

3 years ago

0.2.21

3 years ago

0.2.20

3 years ago

0.2.19

3 years ago

0.2.18

3 years ago

0.2.17

3 years ago

0.2.16

3 years ago

0.2.15

3 years ago

0.2.14

3 years ago

0.2.13

3 years ago

0.2.12

3 years ago

0.2.11

3 years ago

0.2.10

4 years ago

0.2.9

4 years ago

0.2.8

4 years ago

0.2.7

4 years ago

0.2.6

4 years ago

0.2.5

4 years ago

0.2.4

4 years ago

0.2.3

4 years ago

0.2.2

4 years ago

0.2.1

4 years ago

0.2.0

4 years ago

0.1.6

4 years ago

0.1.5

4 years ago

0.1.4

4 years ago

0.1.3

4 years ago

0.1.2

4 years ago

0.1.0

4 years ago

0.1.1

4 years ago

0.0.8

4 years ago

0.0.7

4 years ago

0.0.6

4 years ago

0.0.5

4 years ago

0.0.4

4 years ago

0.0.3

4 years ago

0.0.2

4 years ago

0.0.1

4 years ago