A model with single geometric Elements makes it possible to change this single Elements.

I cant explain how this works while creating a 3D model, but i have seen the strangest adds while exporting to Collada. Swift 3D for example adds extra nod elements for each geometric element, when exporting from Cimena 3D. In the example i have cleaned the structure manually and in this case deleted the extra elements for each geometrical Element. The pic shows the „unclean“ file with head existing twice inside each other:

< node id="head1"> and < node id="head">
also < body> tag is not necessary:

And this is the clean version for head:

Again i recommend to become familiar with the Collada xml structure!
If you dont delete unnecessary elements, also Papervision defines those as DisplaObjects3D, and the fun starts to find out which is the right element to use with setChildMaterialByName:

Papervision traces alle 5×2 geometric elements and the body element:

INFO: DisplayObject3D: COLLADA_Scene
INFO: DisplayObject3D: body
INFO: DisplayObject3D: head1
INFO: DisplayObject3D: head
INFO: DisplayObject3D: hand
INFO: DisplayObject3D: hand1
INFO: DisplayObject3D: ub
INFO: DisplayObject3D: ub1
INFO: DisplayObject3D: lb1
INFO: DisplayObject3D: lb
INFO: DisplayObject3D: shoe
INFO: DisplayObject3D: shoe1

After deleting the unneseccary nots 5 geometric elements remain:

INFO: DisplayObject3D: COLLADA_Scene
INFO: DisplayObject3D: head
INFO: DisplayObject3D: hand
INFO: DisplayObject3D: ub
INFO: DisplayObject3D: lb
INFO: DisplayObject3D: shoe

This way one can work proper, and in the sample

- without texture and Phong Shader – every element is colored different, so you can see the different geometric elements.
Button change between 2 different head textures.

var bitmap:Bitmap = new _imageAsset() as Bitmap;
bitmapMaterial_cloth = new BitmapMaterial(bitmap.bitmapData, true);

var bitmap_bump:Bitmap = new _imageAsset_bump() as Bitmap;	
bitmapMaterial_bump = new BitmapMaterial(bitmap_bump.bitmapData, true);

private function bumpDae(event : MouseEvent) : void {
         dae.setChildMaterialByName("head", bitmapMaterial_bump);
}

private function clothDae(event : MouseEvent) : void {
        dae.setChildMaterialByName("head", bitmapMaterial_cloth);
}

There is a nice Air Tool to optimise Daes from Mark I. Ross.

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

 
Get Adobe Flash player