Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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.
- Host: GitHub
- URL: https://github.com/disketteomelette/aframe-velocity-control
- Owner: disketteomelette
- Created: 2023-06-20T11:50:01.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-06-25T09:56:56.000Z (over 1 year ago)
- Last Synced: 2024-11-02T00:42:14.705Z (2 months ago)
- Topics: a-frame, aframe, aframe-component, aframevr, webxr
- Language: JavaScript
- Homepage:
- Size: 389 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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>