, Jr. Member
EDIT::::::___
Whoops, you want to move them all at once, so this bottom post probably means nothing to you
____:::::::::::
When you cycle through the subgeometry of the FinalMesh that contains your many meshes, you don’t need to cycle through every set of vertices for every cube..
for (var i:int=cubeDatas[meshPartID].startIndex;i<cubeDatas[meshPartID].endIndex;i++){
My data object cubeDatas[] is what contains the information for each cube in my giant mesh, meshPartID is th index that represents my one cube, of many.
.start and .end represent the beginning number if the finalMesh subgeometries, before and after the merge
mergeNum = FinalMesh.geometry.subGeometries[(FinalMesh.geometry.subGeometries.length-1)].vertexData.length/3;
merge.apply(FinalMesh, tempMesh);
mergeNum2 = FinalMesh.geometry.subGeometries[(FinalMesh.geometry.subGeometries.length-1)].vertexData.length/3;
cubeDatas[nameAsNumber]={startIndex: mergeNum, endIndex: mergeNum2, geometrys: (FinalMesh.geometry.subGeometries.length-1), geometrys2: tempGeom, visible: true };
As you see i have mergeNum and mergeNum2, that i store into start and end of my cubeDatas[] object. I figure out the cubes name through nameAsNumber.
Since I know my cubes will never have the same X Y Z coordinates, i figure out they’re name doing this:
nameAsNumber = (1000 * tempMesh.x) + (1000000 * tempMesh.y) + (1000000000 * tempMesh.z)
For lack of a better idea.
That is why you are only cycling through 1 cube x 24 vertices every time