Hello Guys,
I’m experiencing some trouble with Welding and Merging geometries.
At first i just wanted to create an example where i could combine a series of cubes into one and then alter it’s vertices going into the Subgeomety’s vertex data, i found the MergeHelper from Matse in the forum which helped me have my 3 cubes in one container but when i wanted to alter the vertex data i saw the faces were actually independent from the whole, experimenting issues like the first 4 screenshots i put below.
Then i found about welding, and it seemed to be the last piece, but when i weld my container it seems to not do the job fully, the some faces where more connected some not, plus it distorted my merged container of boxes, like i show in the last 3 screenshots.
I tried also not merging but only welding the container and got the same result.
Can you give me some light from my issue?
I post the code where i merge and weld the 3 cubes, they all share the same geometry and colorMaterial
Thank you very much.
private function setupPrimitivesAndModels() : void {
var cWidth : int = 50;
_cubeGeometry = new CubeGeometry(cWidth, cWidth, cWidth);
_container = new ObjectContainer3D();
_nuBox1 = new CustomBox(_cubeGeometry, mat);
_nuBox2 = new CustomBox(_cubeGeometry, mat);
_nuBox3 = new CustomBox(_cubeGeometry, mat);
_container.addChild(_nuBox1);
_container.addChild(_nuBox2);
_container.addChild(_nuBox3);
view.scene.addChild(_container);
_nuBox1.x = 100;
_nuBox1.y = 100;
_nuBox1.z = 100;
_nuBox2.x = 150;
_nuBox2.y = 100;
_nuBox2.z = 100;
_nuBox3.x = 200;
_nuBox3.y = 100;
_nuBox3.z = 100;
MergeHelper.mergeContainer(_container);
Weld.apply(_container);
}