thx zooli, sry for delay, abit busy here , i'll chk it today
2009/1/28 zooli <[email protected]> > > well, it turns to be, there are other errors too, now i found that > also in Collada.as, the getColorValue function does not work, when > some of the color parts are 0. so, here is it corrected: > > private function getColorValue(color:XML):uint > { > if (!color || color.length() == 0) > return 0xFFFFFF; > > var colorArray:Array = color.color.split(" "); > > var colorvalue:uint = Math.floor(colorArray[0] * > 255) << 16; > colorvalue += Math.floor(colorArray[1] * 255) << 8; > colorvalue += Math.floor(colorArray[2] * 255); > > return colorvalue; > > //var colorString:String = (colorArray[0] * > 255).toString(16) + > (colorArray[1] * 255).toString(16) + (colorArray[2] * 255).toString > (16); > //return parseInt(colorString, 16); > } > > the commented code is the current, buggy stuff. > > please commit these, i believe others need them too. > > -- > zooli > > On jan. 23, 12:31, zooli <[email protected]> wrote: > > hi! > > > > yes, here is one:http://hummezum.hu/temp/proba.dae > > > > -- > > zoolihttp://zooli.pardey.org/ > > > > On jan. 23, 05:57, katopz <[email protected]> wrote: > > > > > Hi zooli > > > > > thx for submitting fixed code, btw do you 've some dae file for test > this > > > issue? > > > i've to test before commit something ;) > > > > > thx for your time > > > > > 2009/1/23 zooli <[email protected]> > > > > > > Hi guys! > > > > > > i had to switch to away3d in a project, which involved 2 cylinders, a > > > > small one in a big one, and papervision doesn't have a z-sorting > > > > method as good as yours, nice job, this works! > > > > > > but i had a problem, that my objects with simple colors got > > > > colormaterial, but the color inside them was 0, so i did a little > > > > debugging and found the error (i'm using flash cs4 ide), i had to > > > > change parseColorMaterial method in the Collada.as file to this: > > > > > > private function parseColorMaterial(cname:String, > > > > materialData:MaterialData):void > > > > { > > > > > > var materia:XML = > > > > collada.library_materials.material.(@id == cname) > > > > [0]; > > > > > > if (materia) { > > > > var effectId:String = getId( > > > > materia.instance_effe...@url ); > > > > var effect:XML = > > > > collada.library_effects.effect.(@id == effectId) > > > > [0]; > > > > > > materialData.ambientColor = > > > > getColorValue(effect..ambient[0]); > > > > materialData.diffuseColor = > > > > getColorValue(effect..diffuse[0]); > > > > materialData.specularColor = > > > > getColorValue(effect..specular[0]); > > > > materialData.shininess = > > > > Number(effect..shininess.float[0]); > > > > } > > > > } > > > > > > basically i changed name to cname in the parameter list, seemed it's > > > > reserved or dunno, and the material variable to materia, because > there > > > > is the material string in the e4x query, and it got some conflicts > > > > with that. > > > > > > so, it's working for me now, please commit, i've seen some mails > > > > complaining about it not working. > > > > > > greetings: > > > > -- > > > > zooli > > > >http://zooli.pardey.org/ > > > > > -- > > > katopzhttp://www.sleepydesign.com > -- katopz http://www.sleepydesign.com
