[Papervision3D] Re move material on plane and add new material

D79 dries at d79.be
Wed Nov 14 07:12:44 PST 2007


hi
I read your post about that issue. But I want a solution where I don't have
to use 2 or more different variables (like you did: 'material' and
'material2') to change the material on a plane.

grts
dries


xero wrote:
> 
>  i wrote this awile ago.
> it changes the material of a plane on mouse over...
> http://www.nabble.com/change-material-of-a-plane-tf3958623.html#a11235324
> 
> hope that helps!
> ____  ___
> \   \/  /___________  ____
> .\     // __ \_  __ \/  _ \
> ./     \  ___/|  | \(  <_> )
> /___/\  \___  >__|---\____/
> |     \_/   \/        |
> | xero harrison       |
> | x at xero.nu           |
> | http://xero.nu      |
> | http://fontvir.us   |
> | http://xero.owns.us |
> `---------------------'
> 
> 
>> ---------- Forwarded message ----------
>> From: D79 <dries at d79.be>
>> To: papervision3D at osflash.org
>> Date: Wed, 14 Nov 2007 05:57:21 -0800 (PST)
>> Subject: [Papervision3D] Re move material on plane and add new material
>>
>> I have troubles with removing a material on plane and adding a new
>> matrial
>> on
>> that same plane.
>> Result: seems like the first material stays on the plane.
>>
>> Parts of my source code:
>>
>> // create plane with precise bitmap material
>> var bmpData:BitmapData = new BitmapData(pageW, pageH, false, 0x00FFFFFF);
>> flipPageFrontMaterialsList = new MaterialsList();
>> flipPageFrontMaterial = new PreciseBitmapMaterial(bmpData);
>> flipPageFrontMaterialsList.addMaterial(flipPageFrontMaterial,"body");
>> flipPageFrontMaterial.oneSide = true;
>> flipPageFrontMaterial.smooth     = true;
>> flipPageFront = new Plane(flipPageFrontMaterial, flipPageW, flipPageH,
>> flipPageSegmentsW, flipPageSegmentsH);
>> scene.addChild(flipPageFront);
>>
>> // remove material
>> flipPageFrontMaterialsList.removeMaterialByName("body");
>>
>> // add new material
>> var bmpData:BitmapData = new BitmapData(pageW, pageH, false, 0x00FF3399);
>> flipPageFrontMaterial = new PreciseBitmapMaterial(bmpData);
>> flipPageFrontMaterial.oneSide = true;
>> flipPageFrontMaterial.smooth     = true;
>> flipPageFrontMaterialsList.addMaterial(flipPageFrontMaterial,"body");
>> flipPageFront.material = flipPageFrontMaterial;
>>
>>
>> Can somebody explain what is wrong?
>>
>> grts
>> dries
>>
>> -----
>> D79
>> www.d79.be
>> --
>> View this message in context:
>> http://www.nabble.com/Remove-material-on-plane-and-add-new-material-tf4804141.html#a13744094
>> Sent from the Papervision3D mailing list archive at
>> Nabble.com<http://nabble.com/>
>> .
>>
>>
> 
> _______________________________________________
> Papervision3D mailing list
> Papervision3D at osflash.org
> http://osflash.org/mailman/listinfo/papervision3d_osflash.org
> 
> 


-----
D79
www.d79.be
-- 
View this message in context: http://www.nabble.com/Re%3A-Re-move-material-on-plane-and-add-new-material-tf4805527.html#a13748545
Sent from the Papervision3D mailing list archive at Nabble.com.




More information about the Papervision3D mailing list