1.0.7 • Published 7 months ago

cumulus-3d-engine v1.0.7

Weekly downloads
-
License
ISC
Repository
-
Last release
7 months ago

cumulus-3d-engine

how to start

Start the 3d monument renderer by supplying a canvas parent element and a config:

import c3e from 'cumulus-3d-engine';

const config = {
    "assets" : "/some-endpoint-where-public-assets-are-storred",
    "monumentDescriptor" : "/monument.json",
};

const c3eObj = new c3e(document.getElementById("canvasParent"), config);
c3eObj.Render();

config

Current config object looks like:

config = {
	"assets": "", // REQUIRED url to request static assets from
	"monumentDescriptor": "", // REQUIRED assets url suffix for monument description json file
	"userEndpoint": "", // i don't know what this is but we may need it!
	"cache": false,
	"testCube": false,
	"showFPS": true,
};

the assets property should should contain a copy of this project's Public folder. These assets do not change based on the user.

API

Several functions to manipulate the monument are exposed:

UpdateHdri

UpdateHdri (index)

index corresponds to an index within the array: ["PisaHDR", "ArielSky", "RestingPlace", "ScythianTombs2"];.

Updates the HDRI Skybox around the monument.

SetImage

SetImage (imageUrl)

imageUrl url to an image file.

Set an image on the image panel based on a url.

GetImage

GetImage ()

returns the current image texture from Threejs.

SetTitle

SetTitle (title)

title The title to display.

Set title to display in 3D geometry at the top of the monument.

GetTitle

GetTitle ()

returns the current title.

SetText

SetText (panelId, newText)

panelId the int panel ID that corresponds to a text panel.

text a string text to display within the chosen panel.

Sets the text to be displayed at a chose panel. Since there can be many text panels in the monument, the panelId parameter is used to specify which one is to be used to display the specific text.

GetText

GetText (panelId)

panelId the int panel ID that corresponds to a text panel.

returns the text in a panel.

Reset

Reset ()

Reset the camera to its original position

1.0.7

7 months ago

1.0.4

8 months ago

1.0.2

8 months ago

1.0.1

8 months ago