Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/disketteomelette/aframe-velocity-control

A component in A-Frame that allows increasing or decreasing the velocity of an object's animation using clickable entities and based on a user-provided factor.
https://github.com/disketteomelette/aframe-velocity-control

a-frame aframe aframe-component aframevr webxr

Last synced: 13 days ago
JSON representation

A component in A-Frame that allows increasing or decreasing the velocity of an object's animation using clickable entities and based on a user-provided factor.

Awesome Lists containing this project

README

        

# aframe-velocity-control
A component in A-Frame that allows increasing or decreasing the velocity of any independent object animation using clickable entities and based on a user-provided factor.

Live demo: https://hypnotic-berry-custard.glitch.me/

![Animated gif of a-frame velocity control custom component in action](https://raw.githubusercontent.com/disketteomelette/aframe-velocity-control/main/sample.gif)

# how to call it

Put the js file in your desired directory and call it with a script tag on your scene:

# component properties


schema: {

target: { type: 'selector' },

factor: { type: 'number', default: 1.5 },

type: { type: 'string', default: 'increase' },

Target is id of the object you want to control. I. ex. *sphere1*.

Factor is the multiplying/divisor factor to increase/decrease velocity. In example, *1.5*.

Type is a boolean for button function, must be: *increase* or *decrease*.

Example:

<a-box id="increaseVelocidad1" color="green" scale="0.2 0.2 0.1" velocity-control="target: #sphere1; factor: 1.5; type: increase"></a-box>

<a-box id="decreaseVelocidad1" color="red" scale="0.2 0.2 0.1" position="0 -0.3 0" velocity-control="target: #sphere1; factor: 1.5; type: decrease"></a-box>