Skip to content

Setting mesh scalars from array #152

@ivmartel

Description

@ivmartel

Hi,
When setting the mesh scalars from an array (as suggested on L15 of lesson 12), it seems its min/max are not recalculated. I'm doing it this way:

mesh.scalars.array = xScalars;
mesh.scalars.lowerThreshold = min;
mesh.scalars.upperThreshold = max;
mesh.scalars.minColor = [0.69, 0.66, 0.91];
mesh.scalars.maxColor = [0.75, 0.60, 0.67];
mesh.modified();

This does not affect the display but dat.gui is lost for a threshold setting as:

var maxThresholdController = scalarsgui.add(mesh.scalars, 'upperThreshold',
   mesh.scalars.min, mesh.scalars.max);

I added a min/max find loop in the if (scalars ) { (L1132) of renderer3D.js which solves the problem. Is this correct or am I missing something?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions