将对象添加到场景后如何更新 width , height ? Three.PlaneGeometry (宽度,高度,1,1)

How do I update width , height after object was added to the scene? Three.PlaneGeometry ( width,height,1,1)

应用程序显示照片。 当用户点击一张照片时我想改变它的大小和位置 更改位置适用于此代码: photo.position.y=700; photo.position.x=700; 但我不知道如何更改使用以下设置的宽度和高度: Three.PlaneGeometry (宽度,高度,1,1) (我不想移动相机也不想截头)

创建 Mesh 后,您可以修改其 scale 参数。

var imageGeom = new THREE.PlaneGeometry(1, 1, 1, 1); // Create a 1x1 plane
var imageFrame = new THREE.Mesh(geometry, material); // Build mesh with geometry

// Now you set up the desired dimensions of the resulting mesh
imageFrame.scale.x = 2;
imageFrame.scale.y = 1.5;

这将为您提供一个按比例放大的网格,其最终尺寸为 2 x 1.5。首次创建 PlaneGeometry 后,您不需要更改它;为了简单起见,从 1x1 开始,然后缩放网格。