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

threevision

v1.0.3

Published

A interactive threevision to display your images or videos, built with three.js

Downloads

17

Readme

threevision

NPM package Build Size Dependencies

An interactive trivision display for three.js.

Demo

Based on traditional trivision billboards, but this digital version allows for more than three different images or even videos to be displayed. If more than three textures are supplied, the texture shifting takes place on the backside of the display during the prisms rotation. For an example integration in three.js, check out the demo sourcecode from the examples directory.

trivision-image

Quick start

import Threevision from 'threevision';

or

var Threevision = require('threevision');

or even

<script src="https://unpkg.com/threevision"></script>

then

//prepare some materials
var materials = []

var texture = new THREE.TextureLoader().load("someImage.jpg");
materials.push(new THREE.MeshBasicMaterial({ map: texture }));

var color = new THREE.Color("hsl(100, 75%, 50%)");
materials.push(new THREE.MeshBasicMaterial({ color: color }));

//create a threevision
var threevision = new Threevision({materials, width: 100, height: 100});
var myScene = new THREE.Scene();
myScene.add(threevision);

//make threevision shift avery 2 seconds
let stepCounter = setInterval(() => {threevision.step = step; step += 1;}, 2000);

//in animation loop
(function animate(){
    threevision.update();
    })();

API reference

Constructor

Threevision ([materials, width, height])

Properties

| Property | Description | Default | | ---------------- | ----------------------------------------------------------------------------------------------------------------------------- | :-----: | | materials | Array with containing Three.js textures. This is what will be displayed. See the example for how to display images, videos or colors. | | | width | The width of the threevision display. | 100 | | height | The height of the threevision display. | 100 | | step | Index of the material to be facing frontwards. Changing step makes the threevision display rotate. | 0 | | prismCount | The amount of prism elements of the threevision display. | 24 | | vertical | The orientation of the prisms. | false | | easing | The easing of the prisms rotations. | 0.05 | | speed | The max speed of the prisms rotations. | 1 | | mouseOverEffect | Applies a mouse-over effect that adds a wave-like animation. | false | | shadows | If the THREE.Scene is prepared for shadows, the threevision displays shadow behavior can be manually switched on/off. | true |

Animation update

threevision.update([scene,camera,mousePos])`

| Property | Description | Type | | --------------- | ------------------------------------------------------------------------------------- | :-----------: | | scene | The main scene. Required only if mouseOverEffect is set to true. | THREE.Scene | | camera | The main camera. Required only if mouseOverEffect is set to true. | THREE.Camera | | mousePos | The current mouse position. Required only if mouseOverEffect is set to true. | THREE.Vector2 |