Constructor
new LegoMockupVisualizer(domElement)
Sets up a Three.js scene to visualize the lego mock up.
Parameters:
Name | Type | Description |
---|---|---|
domElement | HTMLElement | HTML element that will be used as the container for the Three.js scene. |
- Source
Classes
Members
camera :PerspectiveCamera
Type:
- PerspectiveCamera
- Source
domElement :HTMLDivElement
Type:
- HTMLDivElement
- Source
otbitControls :OrbitControls
Type:
- OrbitControls
- Source
scene :Scene
Type:
- Scene
- Source
Methods
addLegoPlateSimulation(heightMap, xPlates, yPlates)
Adds Lego blocks to threejs scene based on a given heightmap.
Parameters:
Name | Type | Description |
---|---|---|
heightMap | Array.<Array.<number>> | 2D array representing the height values of the terrain. |
xPlates | number | The number of Lego plates to be added horizontally in the mockup. |
yPlates | number | The number of Lego plates to be added vertically in the mockup. |
- Source
createTHREEScene()
Creates a three.js scene with a camera, renderer, lights, and orbit controls.
- Source
dispose()
Clears the inner HTML of a DOM element and disposes of an orbit object.
- Source