MultiLayerColor class

Create a multi layered volume rendering. It takes in a 2D texture representing the multiple layers in xy plane. The volume is extruded by interpolating the values in xy planes.

Signature:

export default class MultiLayerColor extends Visualize 

Extends: Visualize

Example

var textureBuffer = new Float32Array(2048 * 2048);
for (var i = 0; i < 2048; i++) {
    for (var j = 0; j < 2048; j++) {
        var distance = Math.sqrt(Math.pow((i - 1024), 2) + Math.pow((j - 1024), 2));
        textureBuffer[i * 2048 + j] = Math.max(0.0, 1 - distance / 512);
    }
}

const volume = new Modelo.Scene3D.Visualize.MultiLayerColor(viewer.getRenderScene());
viewer.getScene().addVisualize(volume);
volume.setParameter("gridSize", [8, 6]); // Set the grid size of the texture.
volume.setParameter("layers", 48); // total layers of data
volume.setParameter("data", { "data": textureBuffer, "width": 2048, "height": 1536} );
volume.setParameter("platteImage", "platte.png");
volume.setParameter("gradientImage", "density.png");
volume.setScaling([50, 50, 15]);
volume.setPosition([0, 0, 7.7]);
volume.setEnabled(true);

Constructors

ConstructorDescription
(constructor)(renderScene)Construct a volume rendering object.

Methods

MethodDescription
getVolumeTexture()
setParameter(name, value)Set the rendering parameters of bar chart visualization.
setPosition(position)
setRotation(axis, angle)Set the rotation of visualization object.
setRotationByQuat(quat)Set rotation by quaternion.
setScaling(scale)Set the size of visualization object.