Catalog npm
PACKAGE EXPLORERView in registry

3base

npm

3d Web Application Engine (THREE.js and Ammo.js Wrapper)

Versions collected27
Direct dependencies10From release 0.1.31
Last observed20 Oct, 19:30 UTC

README

Current package documentation

3Base

3d Web Application Engine

Install

yarn add 3base

Usage Example

Folder Scructure

.
├── README.md
├── package-lock.json
├── package.json
├── src
│   ├── ExampleScene.js
│   ├── index.js
├── srv
│   ├── assets
│   │   ├── audio
│   │   ├── images
│   │   ├── models
│   │   └── stylesheets
│   ├── bundle.js
│   └── index.html
├── webpack.config.js
└── yarn.lock

webpack.config.js

const path = require('path');

module.exports = {
  node: {
    fs: "empty" // Nedded For Ammo.js, webpack does weird things with node fs module...
  },

  entry: {
    app: './src/index.js',
  },

  output: {
    path: path.join( __dirname + "/srv"),
    filename: 'bundle.js'
  },

  module: {
    rules: [
      {
        test: /\.(js|jsx)$/,
        exclude: /node_modules/,
        use: ['babel-loader']
      }
    ]
  },
  
  devServer: {
    port: 10001
  }
};

index.html

<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <title>Three Base Example</title>
  <link rel="stylesheet" type="text/css" href="./assets/stylesheets/main.css">
</head>
<body>
  <canvas id="myCanvas" width="500" height="300"></canvas>
  <script src="bundle.js"></script>
</body>
</html>

index.js

'use-strict';

import * as tb from '3base';
import Scene1 from './Scene1';

let manager = new tb.Manager({canvas: myCanvas});
manager.loadScene(Scene1);

Scene1.js

'use-strict';

import * as tb from '3base';

export default class ExampleScene extends tb.Scene {

  constructor(manager) {
    super(manager);// required
    this.load(); // required
  }
  
  createScene(){
    new tb.Sky(this, this.manager.loadTexture('assets/images/sky.jpg')).addToScene();
    new tb.Ground(this, this.manager.loadTexture( 'assets/images/ground.jpg')).addToScene();
    new tb.GLTFModel(this, 0, 0, -10, 'assets/models/deadpool', 3, 0, true)
    .then(deadpool=>{
      deadpool.playAnimation(0);
    })
  }

  createLights(){
    let dl = new tb.DirectionalLight(this, 1, 200, 0);
    dl.addShadow(-30,30,30,-30);
    dl.addToScene()

    let skyColor = 0xe5efff;
    let groundColor = 0xecffd1;
    new tb.HemisphereLight(this, skyColor, groundColor, 0.02).addToScene();
  }
}

PRs are Welcomed and Encouraged!!

Please Report Any Issues

Downloads & popularity

Awaiting observations

No metric observations yet

Download counts and popularity will appear here as the collector receives them.

Versions 27

Collected releases
VersionPublishedDirect dependenciesOpen version
0.1.31Registry latest1 Sept 202010
0.1.3018 Aug 202010
0.1.2510 Feb 201910
0.1.249 Feb 201910
0.1.239 Feb 201910
0.1.229 Feb 201910
0.1.2114 Dec 201810
0.1.2014 Dec 201811
0.1.1919 Nov 201811
0.1.1819 Nov 201811
0.1.1712 Oct 201811
0.1.1612 Oct 201811
0.1.1512 Oct 201811
0.1.1412 Oct 201811
0.1.1312 Oct 201811
0.1.129 Oct 201811
0.1.119 Oct 201811
0.1.99 Oct 201811
0.1.89 Oct 201811
0.1.78 Oct 201811

Package advisories

0
No matching advisories collected

This describes our collected data; it is not a security assessment.

Repository

PENDING
seemywingz/3base

Shared repository data · GitHub

License detected in repository
Not collected

Metadata history

Meaningful changes
Current collected state Current

Observed since 20 Oct, 19:30 UTC

No superseded metadata states collected. Unchanged observations do not create new revisions.

Record identity

package:006784479df9685053431d4b5b55ab7382841f13c819ab5f332d90b12764f68d