3.0.2 • Published 7 years ago

aframe-randomizer-components v3.0.2

Weekly downloads
107
License
MIT
Repository
github
Last release
7 years ago

aframe-randomizer-components

Randomizer components for A-Frame.

Properties

random-color

PropertyDescriptionDefault Value
minMinimum RGB vector.0 0 0
maxMaximum RGB vector.1 1 1

random-position

PropertyDescriptionDefault Value
minMinimum position bounds.-10 -10 -10
maxMaximum position bounds.10 10 10

random-spherical-position

Random position that maps to a surface of a bounding sphere.

PropertyDescriptionDefault Value
radiusRadius of bounding sphere10
startXStart angle.0
lengthXSweep or arc angle.360
startYStart angle.0
lengthYSweep or arc angle.360

random-rotation

PropertyDescriptionDefault Value
minMinimum rotation angles.0 0 0
maxMaximum rotation angles.360 360 360

random-scale

PropertyDescriptionDefault Value
minMinimum scale components.1 1 1
maxMaximum scale components.2 2 2

Usage

Browser Installation

Install and use by directly including the browser files:

<head>
  <title>My A-Frame Scene</title>
  <script src="https://aframe.io/releases/0.3.0/aframe.min.js"></script>
  <script src="https://unpkg.com/aframe-randomizer-components@^3.0.1/dist/aframe-randomizer-components.min.js"></script>
</head>

<body>
  <a-scene>
    <a-entity geometry="primitive: box"
              random-position random-rotation random-scale></a-entity>
  </a-scene>
</body>

NPM Installation

Install via NPM:

npm install aframe-randomizer-components

Then register and use.

require('aframe');
require('aframe-randomizer-components');