Code Monkey home page Code Monkey logo

sample-assets's Introduction

sample-assets

Curated collection of assets (images, models and sounds) to use in A-Frame.

Work in progress.

Folder structure

You can have as many subfolders as you want in the assets folder, each folder on the tree will be added as tags automatically to the final file. In the following folder structure noiseperlin.jpg image will have tags=[noise, perlin]:

- noise
  - perlin
      noiseperlin.jpg  

Licenses

Inside each assets folder (image/sound/model) you could include a root level license.txt that will apply by default to any asset that doesn't contains a specific license. You can override the license for one folder and its subfolders just by including a license.txt file. If you want to specify a license for just one file while leaving the default license for the rest of them, just include a filename.txt to the same folder of the original file.

For example:

license.txt            [LicenseA]
- particles             * LicenseA applied
- noise
  license.txt          [LicenseB]
  - perlin              * LicenseB applied
      noiseperlin.txt  [Specific file license]
      noiseperlin.jpg   * noiseperlin.txt license
      perlin0.jpg       * LicenseB applied
      perlin1.jpg       * LicenseB applied

JSON Structure

The generated JSON files for each assets are stored on the build folder. They share the same structure:

  • licenseId: Index of the license used for this asset
  • id: Valid HTML ID for the asset
  • path: Relative path to the file
  • tags: Array with tags for this asset

Example of JSON file for images:

{
  "licenses": [
    "MIT Three.js project\n"
  ],
  "images": [
    {
      "licenseId": 0,
      "id": "brick_bump",
      "path": "images/bricks/brick_bump.jpg",
      "tags": [ "bricks" ]
    }
  ]
}

How to build

To build the output JSON files for each asset type you should execute the following command:

npm run build

How to use it

You can fetch the assets JSON using the following url:

https://aframevr.github.io/sample-assets/build/images.json

sample-assets's People

Contributors

fernandojsg 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.