NamiW
NamiW

Reputation: 1692

JavaScript three.js 3d engine: how to make object bigger by 20%?

I've got an object by:

planeWall=new THREE.Mesh(new THREE.PlaneGeometry(10,5,1,1), material);

Then I want to make it bigger, say, 20%
so I tried:

planeWall.geometry=new THREE.PlaneGeometry(12,6,1,1);

but failed,debugger says:

TypeError: Cannot read property 'radius' of null

Is there anyone has some experience for this?

Upvotes: 0

Views: 2270

Answers (2)

George Profenza
George Profenza

Reputation: 51837

or similarly to Kuka's answer

planeWall.scale.multiplyScalar(1.2);

The idea is the transform properties(position,rotation,scale) are Vector3 instances so you can use the methods provided to easily transform your meshes.

Upvotes: 3

Kuka
Kuka

Reputation: 145

try planeWall.scale.set(1.2,1.2,1.2);

Upvotes: 2

Related Questions