Giter VIP home page Giter VIP logo

mova's Introduction

Museum of Virtual Arts (MoVA)

Cryptovrontier's Museum of Virtual Arts (MoVA)

Description

This is the code for the Museum of Virtual Arts (MoVA), a flexible virtual structure for the exhibition of virtual artworks. Key vision of this project is to create a "Building as Code" that can adapt in its layout and sizing (capacity) to the needs of its builder. I publish the building and its code as open source under the Apache License 2.0 so feel free to copy and re-use!

MoVA will be placed in Aetheria, Decentraland (coordinates will be published here).

Structural components

The building consists of square modules being linked with each via connectors forming a module level. Levels can be stacked on top of each other to from a larger structure (got inspired by the "The Stacks" in Ready Player One). The modules are all of the same size which can be configured by the builder.

In order to access the different levels of the building, an elevator has been implemented.

Prerequisites

The code requires to have Decentraland utils installed. To do so, you need to run the following command in your source code folder:

npm install decentraland-ecs-utils

See their repository https://github.com/decentraland/decentraland-ecs-utils for further infos.

Sample creation of a building

In order to create a 3 x 3 x 3 structure of 6m (length and width) and 4m (height) modules with 10cm thick walls you will need the following code:

// Importnpm install decentraland-ecs-utils the building library
import {Building} from "./mova/library"

// Module (6m length, 6m width, 4m height and 10cm thick walls)
let moduleDimension: Vector3 = new Vector3(6, 4, 0.1)

// Opening passage of a module (4m height, 4m width and 10cm thick)
let openingDimension: Vector3 = new Vector3(4, 4, 0.1)

// Connector between modules (4m width, 4m length and 10cm thick)
let connectorDimension: Vector3 = new Vector3(4, 4, 0.1)

// Position of the building (x, y, z coordinate)
let position: Vector3 = new Vector3(4, 6, 2)

// Rotation of the building (x, y, z using the Euler method)
let rotation: Vector3 = Quaternion.Euler(0, 0, 0)

// Scale of the building (0-100% x, 0-100% y, 0-100%z)
let scale: Vector3 = new Vector3(1, 1, 1)

// Layout of the building (3 levels a 3 x 3 modules with openings to all sides: North, East, South and West)
layout = [
    [
        ['NESW'], ['NESW'], ['NESW'],
        ['NESW'], ['NESW'], ['NESW'],
        ['NESW'], ['NESW'], ['NESW'] 
    ],
    [
        ['NESW'], ['NESW'], ['NESW'],
        ['NESW'], ['NESW'], ['NESW'],
        ['NESW'], ['NESW'], ['NESW'] 
    ],
    [
        ['NESW'], ['NESW'], ['NESW'],
        ['NESW'], ['NESW'], ['NESW'],
        ['NESW'], ['NESW'], ['NESW'] 
    ]
]

// Create the building entity
let MoVASimple: Building = new Building(layout, moduleDimension, openingDimension, connectorDimension)

// Position, rotate and scale it
MoVASimple.addComponent(new Transform({position: position, rotation: rotation, scale: scale}))

// Add building entity to engine
engine.addEntity(MoVASimple)

Sample creation of an elevator

You can create a (very) simple elevator capable of transporting passengers between two levels with the following code:

// Import the elevator library
import {Elevator} from "./mova/elevator"

// Elevator level 1 height of 6m 
let elevatorHeight: number = 6

// Elevator position (x, y, z) with y being level 0 height at ground floor (0m)
let elevatorPosition: Vector3 = new Vector3(2, 0, 8)

// Elevator dimension (width, platform thickness, length)
let elevatorDimension: Vector3 = new Vector3(4, 0.1, 4)

// Create elevator entity
let elevator: Elevator = new Elevator(elevatorHeight, elevatorPosition, elevatorDimension)

// Add entity to engine
engine.addEntity(elevator)

mova's People

Contributors

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