Skip to main content

CubemapProjection

Since version 4.0.0

Projection based on cubemap images, accepts both multiple or single images.

class CubemapProjection extends Projection<{
uTexture: UniformTextureCube | UniformCanvasCube
}>

Extends

  • Projection<{
     uTexture: UniformTextureCube | UniformCanvasCube
    }>

Properties

A 3D triangle mesh for projection. It's null until loading the src.

Source URL to panorama image/video.

Properties for the video element.
Setting false will treat panorama source as an image, true will use default properties.

Methods

Apply texture to current projection.

Return active texture.

Release all resources projection has.
This is automatically called on projection change & View360's destroy call

Update projection.

Update camera to match projection's settings.

Update control to match projection's settings.

Constructor

Create new instance.
new CubemapProjection(options: CubemapProjectionOptions): CubemapProjection

Parameters

Properties

mesh

>=4.0.0
inherited
mesh

null | TriangleMesh<{ uTexture: UniformCanvasCube | UniformTextureCube }>

A 3D triangle mesh for projection. It's null until loading the src.

src

>=4.0.0
readonly inherited
src

string | HTMLElement | (string | HTMLElement)[]

Source URL to panorama image/video.

video

>=4.0.0
readonly inherited
video

undefined | boolean | Partial<VideoConfig>

Properties for the video element.
Setting false will treat panorama source as an image, true will use default properties.

Example

Default properties

autoplay: true
muted: true
loop: false
volume: 1

Methods

applyTexture

>=4.0.0
applyTexture

void

applyTexture(ctx: WebGLContext, texture: Texture2D): void

Apply texture to current projection.

Parameters

ctx

WebGLContext

Instance of the WebGLContext helper

texture

Texture2D

New texture to apply

getTexture

>=4.0.0
inherited
getTexture

null | Texture2D | TextureCube

getTexture(): null | Texture2D | TextureCube

Return active texture.

releaseAllResources

inherited
releaseAllResources

void

releaseAllResources(ctx: WebGLContext): void

Release all resources projection has.
This is automatically called on projection change & View360's destroy call

Parameters

ctx

WebGLContext

update

>=4.0.0
inherited
update

void

update(camera: Camera): void

Update projection.

Parameters

camera

Instance of the camera to reference

updateCamera

>=4.0.0
inherited
updateCamera

void

updateCamera(camera: Camera): void

Update camera to match projection's settings.

Parameters

camera

Instance of the camera to update

updateControl

>=4.0.0
inherited
updateControl

void

updateControl(control: PanoControl): void

Update control to match projection's settings.

Parameters

Instance of the control to update