Let’s say I create a plane such as (this is off the top of my head, so please forgive typo’s):
var planeGeometry:Geometry = new PlaneGeometry(100, 100);
var planeMesh:Mesh = new Mesh(planeGeometry, new ColorMaterial(0xFF0000));
addChild(planeMesh);
And then I decide I want the plane to be 200 x 100, what is the best way to resize the existing plane?
Currently, I remove the plane, create a new one of the proper size, and then re-add it to the scene. The problem is, I am doing this 60 times per second and garbage collection doesn’t have time to kick in and my memory creeps skyward. Not to mention that it’s extremely inefficient.
I figure I probably need to access the subGeometry of the mesh, but I’m not quite sure how to go about doing that.
Thanks for any help/pointers you can give!
—Rob