Thnx for the answer, but no change :(
I get the best results when i create a new Vertext alltogether like
this:
###########################
myFace.v0 = adjustVertex(myFace.v0);
myFace.v1 = adjustVertex(myFace.v1);
myFace.v2 = adjustVertex(myFace.v2);
private function adjustVertex(v:Vertex):Vertex
{
if (v.x > X )
v.x --;
if (v.y > Y)
v.y --;
if (v.z > Z)
v.z --;
return new Vertex(newX, newY, newZ) // of
course newXYZ have to be created first...
}
###########################
but its still unacceptable.
The question with the caching is nothing i want to achieve, but it
seems to me, this is the problem. somehow, away3d remembers what the
vertices look like at the beginning, and then later keeps jumping back
to those initial values.
Since i know, the final position of the vertices, i also tried to
instantiate the vertices with the final position, render the view
once, then change the vertices back to how they should start with, but
still no result. I'm going mad here!!!
Is there some sort of pooling going on??
regards, joergipoergi
On Mar 15, 10:28 pm, Fabrice3D <[email protected]> wrote:
> 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!!