Coder Social home page Coder Social logo

tankerxyz / three.signal-line Goto Github PK

View Code? Open in Web Editor NEW
4.0 2.0 0.0 3.68 MB

library for three.js for creating line and moving particles along the line

Home Page: https://tankerxyz.github.io/three.signal-line/

License: MIT License

TypeScript 100.00%
javascript 3d signal-processing mesh typescript math webgl labels html5 canvas webvr line npm events interaction

three.signal-line's Introduction


NPM version Codecov CircleCI GitHub stars

Three.Signal-Line

three.signal-line is a JavaScript package that provides a signal line component for the popular 3D rendering library, Three.js. It allows you to create animated signal lines in your Three.js scenes with customizable colors, speeds, sizes, and more.

Features

  • Animated Signal Lines: Create visually appealing animated signal lines in your Three.js scenes.
  • Customizable Options: Control the appearance and behavior of signal lines with customizable options such as color, speed, size, opacity, and texture.
  • Backward Movement: Choose whether the signal lines move forward or backward along their paths.
  • Texture Support: Apply textures to signal lines for enhanced visual effects.
  • Smooth Animation: Signal lines smoothly transition between points, creating fluid animations.
  • Easy Integration: The package integrates seamlessly with Three.js, making it easy to incorporate signal lines into your existing Three.js projects.

The package also have nice some things:

  • Backwards compatibility for Node.js-style (CommonJS) imports
  • Both strict and flexible typescript configurations available
  • Collocated, atomic, concurrent unit tests with AVA
  • Source-mapped code coverage reports with nyc
  • Configurable code coverage testing (for continuous integration)
  • Automatic linting and formatting using TSLint and Prettier
  • Automatically check for known vulnerabilities in your dependencies with nsp

Installation

You can install Three.Signal-Line via npm or yarn:

npm install three.signal-line

or

yarn add three.signal-line

Usage

To use Three.Signal-Line, you need to have Three.js already set up in your project. Once you have imported the required dependencies, you can create a signal line by providing the necessary options and a line geometry:

import { SignalLine } from 'three.signal-line';

// Create a Three.js scene
const scene = new THREE.Scene();

// Create options for the SignalLine
const options = {
  linePath: [
    new THREE.Vector3(0, 0, 0),
    new THREE.Vector3(1, 1, 1),
    new THREE.Vector3(2, 2, 2),
  ],
  lineType: LINE_TYPE.NORMAL,
  materialOptions: {
    color: 0xff0000,
    opacity: 1.0,
    blending: THREE.NormalBlending,
    transparent: true,
    depthWrite: true,
    lineWidth: 2,
  },
  isDebug: false,
};

// Create a new SignalLine instance
const signalLine = new SignalLine(options, scene);

Sending Signals:

To sending signals you should pass signal options by using send method:

// Define the options for the signal
const options = {
  color: '#ff0000',
  speed: 200,
  size: 30,
  backwardMoving: false,
  opacity: 0.5,
  particleTexture: 'path/to/texture.png', // not required
}

signalLine.send(options);

Working with Labels:

You can add label by using public addLabel method:

// Define the options for the signal
const options = {
  textOptions: {
    color: "#ff0000",
    size: 2
  },
  position: "start",
  lookAtCamera: false
};

signalLine.addLabel(options);

Documentation

You can find the full documentation on the website.

Examples

You can see full example in this demo.

Example

or you can try to send it by yourself in another simple demo.

Conclusion

With Three.Signal-Line, you can easily create animated signal lines to enhance the visual experience of your Three.js scenes. Whether you need to visualize data flows, create special effects, or add dynamic elements to your 3D environments, Three.Signal-Line provides a flexible and customizable solution. Explore the package documentation and examples to unleash your creativity and bring your Three.js projects to life with stunning signal lines.

three.signal-line's People

Contributors

tankerxyz avatar

Stargazers

M avatar Anser avatar Nikita Zhenev avatar xuegoo avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.