npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

aframe-ground-component

v0.0.5

Published

Infinite grounds for your A-Frame VR scene in just one file.

Downloads

124

Readme

aframe-ground-component

This component provides various sweet looking options for ground in an A-Frame VR scene (no sky, lights or dressings).

This is a fork of the aframe-environment-component by Feiss. The environment component is awesome, but sometimes dressings, sky and lighting is just not needed for your scene so I decided remove those other features and focus on a simpler version.

There are 2 new parameters to add more control over ground placement height (positionY)and scale (groundXZScale).

Make sure you are using A-Frame 0.9.2 or later. Then just include aframe-ground-component.js in your HTML:

  <script src="https://unpkg.com/[email protected]/dist/aframe-ground-component.min.js"></script>

and add the ground component to an entity:

  <a-entity ground></a-entity>

That's it! :)

Presets

The previous code will setup a default scene, but you have a bunch of already predefined presets to choose from, using the preset parameter, like this:

  <a-entity ground="preset: <name of the preset>"></a-entity>

You can view and try all the presets in the aframe-ground-component Test Page. The current list of presets are listed in the next section.

Parameters

Apart from using a preset, you can tweak the ground with many parameters, like this:

  <a-entity ground="groundColor: #445"></a-entity>

You can also select a preset but change some of its parameters:

  <a-entity ground="preset: forest; groundColor: #445; grid: cross"></a-entity>

This is the list of the available parameters.

| Parameter | Default | Description | |-------------|---------|-------------| | active | true | Show/hides the component. Use this instead of using the visible attribute | | preset | 'default' | Valid values: none, default, contact, egypt, checkerboard, forest, goaland, yavapai, goldmine, threetowers, poison, arches, tron, japan, dream, volcano, starry, osiris | | seed | 1 | Seed for randomization. If you don't like the layout of the elements, try another value for the seed. | | shadow | false | Shadows on/off. Sky light casts shadows on the ground of all those objects with shadow component applied | | shadowSize | 10 | Shadows size | | flatShading | false | Whether to show everything smoothed (false) or polygonal (true). | | playArea | 1 | Radius of the area in the center reserved for the player and the gameplay. The ground is flat in there and no objects are placed inside.| | ground | 'hills' | Valid values: none, flat, hills, canyon, spikes, noise. Orography style. | | groundYScale | 3 | Maximum height (in meters) of ground's features (hills, mountains, peaks..) | | groundXZScale | 1 | Integer amount by which to scale the ground in X and Z axes | | groundTexture| 'none' | Valid values: none, checkerboard, squares, walkernoise| | groundColor | '#553e35' | Main color of the ground | | groundColor2| '#694439' | Secondary color of the ground. Used for textures, ignored if groundTexture is none | | grid | 'none' | Valid values: none, 1x1, 2x2, crosses, dots, xlines, ylines. 1x1 and 2x2 are rectangular grids of 1 and 2 meters side, respectively. | | gridColor | '#ccc' | Color of the grid. | | positionY | 0 | Specify custom height for ground | | resolution | 64 | Specify the number of plane subdivisions (lower numbers reduce ground heightmap resolution and saves on triangle count) |

The best way to work with them is to press ctrl-alt-i to open the inspector, search for 'ground' in the filter box and select it, and tweak the parameters while checking the changes in realtime. When you are happy, you can use the Copy attributes button or even better, copy the attributes logged in the browser's dev tools console.

Performance

This component removes all dressings used in environment component so it should perform better than the original environment component. To get even better performance reduce resolution down to a lower number.

Original Credit

This was originally written as environment component by @fiess at aframevr in Slack or Discord.