If you don't need to store the vertices for later use, you could
create the variables inside the function call (just like you did with
the UVs). That would reduce the code a little bit.

Maybe there's a better method, but for now it's running at stable
60fps. The most important factor in deciding which would be the best
method depends on what do you want to do with the faces. In my case i
need to retrieve the position of the faces and manipulate the uvs to
change the their texture mapping (hopefully simulating a
bitmapMaterial change).



On May 9, 5:55 pm, rjgtav <[email protected]> wrote:
> Thanks for the tip. Currently i'm doing it like this:
>
> //BASE
>
> var v1:Vertex = new Vertex(x, y, z);
> var v2:Vertex = new Vertex(x, y, z);
> var v3:Vertex = new Vertex(x, y, z);
> var v4:Vertex = new Vertex(x, y, z);
> FaceHelper.addFace(mesh, v1, v2, v3, new UV(0, 0), new UV(50, 0), new UV(50,
> 50), 0);
> FaceHelper.addFace(mesh, v3, v4, v1, new UV(0, 0), new UV(50, 0), new UV(50,
> 50), 0);
>
> ... and so on, for each face. NOTE: these aren't the true values.
>
> I think that this method is a little big (in code size) - of course im
> creating a function for adding cube faces to a mesh hehe. Is really this the
> best solution?
>
> Thanks :-)

Reply via email to