Updating shared geometry

Software: Away3D 4.x

Avatar
FlyOn, Jr. Member
Posted: 21 April 2012 09:25 AM   Total Posts: 36

I didn’t get any answers in support, so I’m gonna try it as a bug?

I’m trying to update the geometry that several objects share.

geo = new PlaneGeometry();
mesh = new Mesh(geo, new ColorMaterial(0x0ff0f0));
mesh2 = new Mesh(geo, new ColorMaterial(0xffff00));
mesh2.200;
mesh2.200;
scene.addChild(mesh);
scene.addChild(mesh2);
geo.width 400

this will show two planes with 400 as width

But if I remove the line

geo.width 400 

and add it to some onClick eventHandler, the planes remain square even though the code is executed and tracing geo.width shows 400…

My bad or is this a bug?

   

John Brookes, Moderator
Posted: 21 April 2012 10:33 AM   Total Posts: 732   [ # 1 ]

No idea if its a bug, but something like

private function onMeshMouseDown(e:MouseEvent3D):void 
{
 CubeGeometry
((e.object as Mesh).geometry).width += 10;
 (
e.object as Mesh).geometry.subGeometries[0].updateVertexData((e.object as Mesh).geometry.subGeometries[0].vertexData);

would change the width of a cube on mouseclick.

   

Richard Olsson, Administrator
Posted: 21 April 2012 11:18 AM   Total Posts: 1192   [ # 2 ]

If the geometry doesn’t update when you change a property of the primitive geometry class (e.g. PlaneGeometry) then that’s a bug. Please file it! Thanks for letting us know.

   

Avatar
FlyOn, Jr. Member
Posted: 21 April 2012 04:45 PM   Total Posts: 36   [ # 3 ]

ok, clear, will do!

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X