How to use the troika-3d.makeWorldTextureProvider function in troika-3d

To help you get started, we’ve selected a few troika-3d examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github protectwise / troika / packages / troika-examples / inception / InceptionExample.jsx View on Github external
const sphereGeom = new SphereBufferGeometry(0.5, 32, 32)
const boxGeom = new BoxBufferGeometry(1, 1, 1)

class WorldTexturedSphere extends Object3DFacade {
  constructor(parent, subWorldTexture) {
    super(parent, new Mesh(
      sphereGeom,
      new MeshStandardMaterial({
        map: subWorldTexture
      })
    ))
  }
}
WorldTexturedSphere = makeWorldTextureProvider(WorldTexturedSphere)

class WorldTexturedBox extends Object3DFacade {
  constructor(parent, subWorldTexture) {
    super(parent, new Mesh(
      boxGeom,
      new MeshStandardMaterial({
        map: subWorldTexture
      })
    ))
  }
}
WorldTexturedBox = makeWorldTextureProvider(WorldTexturedBox)


class AutoUpdatingArcsFacade extends ArcsFacade {
  constructor(parent) {
github protectwise / troika / packages / troika-examples / inception / InceptionExample.jsx View on Github external
))
  }
}
WorldTexturedSphere = makeWorldTextureProvider(WorldTexturedSphere)

class WorldTexturedBox extends Object3DFacade {
  constructor(parent, subWorldTexture) {
    super(parent, new Mesh(
      boxGeom,
      new MeshStandardMaterial({
        map: subWorldTexture
      })
    ))
  }
}
WorldTexturedBox = makeWorldTextureProvider(WorldTexturedBox)


class AutoUpdatingArcsFacade extends ArcsFacade {
  constructor(parent) {
    super(parent)
    this.data = refreshArcsData(null)
    this._timer = setInterval(() => {
      this.data = refreshArcsData(this.data)
    }, 3000)
  }
  destructor() {
    clearInterval(this._timer)
    super.destructor()
  }
}

troika-3d

Troika 3D

MIT
Latest version published 1 day ago

Package Health Score

73 / 100
Full package analysis

Similar packages