w3reality / platform

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

platform

(WIP) no public releases available yet

Demos

Open source VR websites

Prototype VR websites in W3Reality

Many of our prototype/experimental websites (related to games, multimedia, dataviz, education) can be found in đŸ”¥ https://w3reality.com/

Usage

Here is a minimal VR website implementation using the SDK.App class:

const SDK = window.requirejs('w3reality-sdk');
const THREE = window.THREE;

class MyApp extends SDK.App {
    // override
    static async fetchAssets() {
        return null;
    }

    // override
    static createWorld(assets=null) {
        return SDK.App.createWorld();
    }

    // override
    constructor(data, name='myapp') {
        super(data, name);
        const scene = new THREE.Scene();
        // ... (construct and add THREE objects to scene)
        this.setScene(scene);
    }

    // override
    update(t, dt) {
        super.update(t, dt);
        // ... (implement the dynamic logic)
    }

    // override
    free() {
        super.free();
        // ... (free custom resources if any)
    }
}

export default MyApp;

API

(WIP)

About