Reputation: 123
Is there a way to easily change width and height of plane dynamically? The code below has no effect.
plane.geometry.parameters.width = width;
plane.geometry.parameters.height = height;
Upvotes: 8
Views: 11747
Reputation: 44
This is what worked for me. You can try:
mesh.geometry.width = width;
mesh.updateMatrix();
Upvotes: 1
Reputation: 104763
Create the plane mesh
var geometry = new THREE.PlaneGeometry( 1, 1 );
var mesh = new THREE.Mesh( geometry, material );
You can then dynamically change the dimensions by resetting the scale, like so:
mesh.scale.set( width, height, 1 );
three.js r.74
Upvotes: 19