Skip to content
Advertisement

three.js Cube Geometry – how to update parameters?

Possibly dumb question but here goes. Three.js geometries have ‘parameter’ feilds associated with them, see the box geometry here…

box Geometry parameters

I am trying to update these parameters like this…

JavaScript

But of course, the geometry remains unchanged. Is there a way of updating the geometry by editing these parameters?

fiddle here https://jsfiddle.net/kn3owveg/2/

Any help appreciated!

Advertisement

Answer

Gaitat is totally right, you can’t change geometry with changing of parameters.

And there can be another solution. With scaling of your cube.

JavaScript

jsfiddle example

User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement