npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

threejs-objects

v0.2.25

Published

three.js Object composition

Downloads

10

Readme

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.

| Class | Description | |:-------------|:----------------------------| |ParticleWave |A plane, which consists of particles to simulate a wave effect| |ParticleImage|Random 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

| Parameter | Type | Default | Description | |:----------|:-----|:--------|:------------| | numberParticles | array | [50, 50] | Amount of particles in x and y direction | | particleSize | number | Array | 0.025 | The size of a particle. Could be either a number or an interval to choose a random size per particle. | | particleTexture | string | | Path to the texture of the particles | | waveHeight | number | 1.0 | Amplitude of the wave | | noise | number | 0.0 | A value greater than 0 will add noise to the position of each particle | | particleColor | number | 0xeeeeee | The color of each particle |

Example

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

ParticleImage

Options

| Parameter | Type | Default | Description | |:----------|:-----|:--------|:------------| | image | string | | Path to the image file | | useImageColors | bool | false | If the shaders should render the actual pixel colors | | amplitude | number | 0.05 | The amplitude of the wave effect | | color | Color | Color(1.0, 1.0, 1.0) | If !useImageColors, this option sets the color of each particle | | particleTexture | string | | Path to the texture of the particles | | numberParticles | number | 1000 | The 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"
});