Hey away3dfan if you want to texture a mesh with a bitmapmaterial, you will need to set uv coordinates on each face object to allow teh mesh to 'skin' itself with the bitmapdata you use in any bitmapmaterial. Have a closer look at any of the primitive classes like sphere or plane to see how you create and apply these uv coordinates
cheers Rob On Fri, Jul 3, 2009 at 8:36 AM, away3dfan <[email protected]> wrote: > > In my last post here I was working with the assignment of dynamic > materials to custom-defined objects, but I think this was a bit > premature for my understanding, so here I'm asking a question about > only one piece of my problem: > > I would like to create a custom mesh (a flat plane cutout, really) and > apply *one* material stretched across all the faces in the cutout (the > way it is when a texture is applied to a sphere for example). This is > what I tried: > > // In class > [Embed(source="C:/pic.jpg")] > public var earthBitmap:Class; > > // In function > var texturedShape:Mesh = new Mesh(); > var f:Face = new Face( v1a, v2a, v3a ); > var f2:Face = new Face( v1b, v2b, v3b ); > texturedShape.addFace(f); > texturedShape.addFace(f2); > texturedShape.material = new PhongBitmapMaterial( Cast.bitmap > (earthBitmap) ); > _scene.addChild( texturedShape ); > > However, this results in the entire screen going black when the face > is in view of the camera. The problem also occurs when only one face > is used. Please can you tell me what is the correct way to apply an > embedded texture to one face, or across multiple faces of a single > mesh? This will help me very much. > > Thank you! > > > > > PS: Ideally I would have created only one surface with slanted edges > to create the shape I want, but I believe the only way to do it is > with individual faces, so this is the method that I'm currently using > even though it results in tiny spaces between a couple of the faces > which I have not found a way to get rid of yet. -- Rob Bateman Flash Development & Consultancy [email protected] www.infiniteturtles.co.uk www.away3d.com
