PDA

View Full Version : PaperVision3D - Add a material to a DAE



barliesque
March 12th, 2009, 08:46 PM
I've successfully loaded a DAE model with its own bitmap texture material. Now I want to layer an environment map over that to give it a shiny look. I'm about ready to go out of my mind---nothing seems to work. I've created my environment map material, and added it to the DAE model, but it fails to appear at all. I've cut some holes in the original bitmap material, so that I'd be able to see if the reflection was covered over, but nothing appears to be hiding underneath. What to do??? :stare:

miyijura
March 13th, 2009, 09:04 PM
Your material have a name?
You can do something like this:

material.addMaterial(ResourceManager.MAT1_Tex, "redmat1");//material ID1 for mapping

where ResourceManager is a class with all the assets like this

public class ResourceManager
{
//embeding DAE model
[Embed (source="chair.dae", mimeType="application/octet-stream")]
public static const Chair:Class;
public static const ChairXML:XML = function():XML{var byteArray:ByteArray = new Chair() as ByteArray; return new XML(byteArray.readUTFBytes(byteArray.length));}();
//************************************
//for each material create a MAT class
[Embed (source="../media/001briques.jpg")]
}
}

all this is inside Flex my friend....give it a try