If you have a plane on the XZ-plane (1 x 1):
var planeGeom = new THREE.PlaneGeometry(1, 1);
planeGeom.rotateX(-Math.PI / 2);
var plane = new THREE.Mesh(planeGeom, new THREE.MeshStandardMaterial({
color: "green"
}));
scene.add(plane);
then you can create an instance of dat.GUI
and set its controllers like this:
parameters = {
x: 1,
area: 1,
}
var gui = new dat.GUI();
gui.add(parameters, 'x', 1, 400).name("Scale XY (in)").onChange(
function(value) {
plane.scale.set(value, 1, value);
parameters.area = value * value; // update the value of parameters.area
}
);
gui.add(parameters, "area", 1).name("Surface area=").listen(); // listen for updating of the value
It's based on the example of dat.GUI
jsfiddle example.