Giter Club home page Giter Club logo

aframe-trail-component's Introduction

aframe-trail-component


Trail component base upon code by svartmc.

API

Parameter Default Description
length 80 The length of the trail.
width 0.8 The width of the trail.
resolution 18 The detail of the trail.
color white The color of the trail.
offset 0 0 0 The offset of the trail.

Usage

pic

Include script tag in HTML Head

<script src="https://aframe.io/releases/1.3.0/aframe.min.js"></script>
<script src="https://cdn.jsdelivr.net/gh/EricEisaman/[email protected]/aframe-trail-component.min.js"></script>

HTML (entity with single trail instance and default settings)

<a-sphere trail></a-sphere>

pic

HTML (entity with multiple trail instances and custom settings)

<a-sphere 
trail__red="color:red; offset:-1 0 0"
trail__white="color:white; length:120"
trail__blue="color:blue; offset:1 0 0"
grabbable
></a-sphere>

JS (single instance on an entity)

const s = document.createElement('a-sphere');
s.setAttribute('trail','length:50; width:0.9; resolution:10');
AFRAME.scenes[0].appendChild(s);

pic

JS (multiple instances on an entity)

const s = document.createElement('a-sphere');
s.setAttribute('trail__red','color:red; offset:-1 0 0');
s.setAttribute('trail__white','color:white; length:120');
s.setAttribute('trail__blue','color:blue; offset:1 0 0');
s.setAttribute('color','blue');
s.setAttribute('radius', 0.5);
s.setAttribute('circle-movement','center:0 6 -20; radius: 6');
AFRAME.scenes[0].appendChild(s);

pic

aframe-trail-component's People

Contributors

ericeisaman avatar mrxz 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.