use v0.setValue(x:Number, y:Number, z:Number); instead.
if you want keep a copy, simply
var origVerts:Array = []
origVerts = origVerts.concat(myMesh.vertices);
Fabrice
On Mar 15, 2011, at 2:24 PM, joergipoergi wrote:
> Hi everybody. Started Away3d a month ago, and it's been going great!!
>
> I encountered a strange problem.
> I create a new face from an existing one like this:
>
>
> #########################
> myFace = createFace(face);
> private function createFace(f:Face):Face{
> var v0:Vertex = new Vertex(f.v0.x, f.v0.y, f.v0.z);
> var v1:Vertex = new Vertex(f.v1.x, f.v1.y, f.v1.z);
> var v2:Vertex = new Vertex(f.v2.x, f.v2.y, f.v2.z);
> var uv0:UV = new UV(f.uv0.u, f.uv0.v);
> var uv1:UV = new UV(f.uv1.u, f.uv1.v);
> var uv2:UV = new UV(f.uv2.u, f.uv2.v);
> return new Face(v0, v1, v2, new
> ColorMaterial(0x0000ff), uv0, uv1,
> uv2);
> }
> ###########################
>
>
> then I alter the face by moving it's vertices around a little.
> (simplified code)
>
> ###########################
>
> adjustVertex(myFace.v0);
> adjustVertex(myFace.v1);
> adjustVertex(myFace.v2);
>
> private function adjustVertex(v:Vertex):void
> {
> if (v.x > X )
> v.x --;
>
> if (v.y > Y)
> v.y --;
>
> if (v.z > Z)
> v.z --;
> }
>
> ###########################
>
> The problem is, it works, but if i move the camera angle around, on
> some angles it shows the face in its original position (especially
> when zooming out), as if i did not at all change the vertices??? but
> clearly i did, because, most camera angles it renders ok.
> The face is nested inside a mesh, which itself is nested inside an
> ObjectContainer3D.
>
> ########################
>
> myMesh.addFace(myFace);
> container:ObjectContainer3D = new ObjectContainer3D(myMesh);
>
> #######################
>
> Is there some sort of caching mechanism, that keeps the original
> Vertices? I would not even know how this is possible. Could that even
> be that omniouse memory leak, everybody is looking for??
>
> Any help much appreciated!!