General Structure
nikatlas laboja lapu 7 gadi atpakaļ

The general structure of the scene is actually pretty simple.

There is a normal THREEJS Scene where we add the lights, the skybox and the platform.

  • The Platform consists of a bunch of abstract Object3D(Scene entities without graphic representation) representing the different layers.
  • Each Layer consists of a number of different Quantos. Quanto is a special structure that carries a shared Geometry and a shared Material, along with other properties like color(not shared accros materials).

The Graph Scene is pretty easy to visualize (or if u are lazy https://www.youtube.com/watch?v=6mXM-oGggrM)!

  • Take each Quanto i,j that is in a Layer and translate it to position (x,y,z) = (i,y,j)
  • Take each Layer k and move it to position (x,y,z) = (x,k,z)
  • Take each Platform(one in our case) and translate it and rotate it wherever in scene.

Shape is the abstract class for the different droppables we can have. Every shape is uniquely defined by its array of positions(a.k.a. geometry). The Geometry information is then used by our Game Class to show/hide all the occupied Quantos of the platform after translating and rotating according to the instances' properties.