Skip to content

Instantly share code, notes, and snippets.

@lamberta
Created April 16, 2010 04:34
Show Gist options
  • Save lamberta/368010 to your computer and use it in GitHub Desktop.
Save lamberta/368010 to your computer and use it in GitHub Desktop.
pv3d materials sample
<instance_material symbol="lambert1SG" target="#myShaderName"/>
//create material list
var matList:MaterialsList = new MaterialsList();
//convert to a bitmap
var textureBitmap:Bitmap = new myTexture() as Bitmap;
//now swap our bitmap material into the shader name that we found in the collada
matList.addMaterial(new BitmapMaterial(textureBitmap.bitmapData), "lambert1SG");
//once you have your collada loaded then apply the material list
model.materials = matList;
viewport.getChildLayer(model.getChildByName("floor", true));
var wordLayer:ViewportLayer = viewport.getChildLayer(model.getChildByName("words", true));
wordLayer.alpha = 0.8;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment