[Papervision3D] Material Tile
Roy Wiggins
bungadunga at gmail.com
Mon Jun 30 13:19:25 PDT 2008
Hmm, I dunno. Could be they broke it somewhere along the line? I'm using a
rather earlier rev of Great White.
On Sun, Jun 29, 2008 at 3:03 AM, Unic <haukejaeger at gmx.net> wrote:
>
> I tried that, but giving maxU/maxV a value didn't change anything (.tiled
> was
> set to true). Is there anything else I have to do first? I am using the
> latest version of GreatWhite (Revision 621).
>
>
> Roy Wiggins wrote:
> >
> > I think there's already a maxU and a maxV in materials, you don't need to
> > modify BitmapMaterial. Just do something like this if you want to make a
> > bitmap tile so each tile is a specific width and height:
> >
> > mat.maxU = lenU/bitmapWidth; //LenU is how big the object is in the U
> > direction (on a plane, the width)
> > mat.maxV = lenV/bitmapHeight; //Likewise for lenV, but in the V direction
> >
> > A more reusable way is to extend a Bitmap material. Pass it a lenU and
> > lenV;
> > if you don't give it a width or height it will assume you want to tile it
> > so
> > each tile is as big as the bitmap. If you just give it a width it'll
> > assume
> > it's a square.
> >
> > package {
> > import org.papervision3d.materials.BitmapAssetMaterial; //You can
> > switch these lines to BitmapFileMaterial or whatever, just change the
> > super() call to whatever that class expects.
> > public class TiledMaterial extends BitmapAssetMaterial{
> > function
> > TiledMaterial(linkageID:String,lenU:Number,lenV:Number,wid:Number=0,
> > hght:Number=0, precise:Boolean=false)
> > {
> > super(linkageID, precise)
> > this.tiled = true;
> > //this.smooth = true;
> > if(wid == 0){
> > this.maxU = lenU/bitmap.width;
> > this.maxV = lenV/bitmap.height;
> > }else if (hght == 0){
> > this.maxU = lenU/wid
> > this.maxV = lenV/wid
> > }else{
> > this.maxU = lenU/wid
> > this.maxV = lenV/hght
> > }
> > }
> > }
> > }
> >
> >
> >
> > On Sat, Jun 28, 2008 at 3:17 AM, Unic <haukejaeger at gmx.net> wrote:
> >
>
>
> -----
> 2 is 1 more than 1.
> --
> View this message in context:
> http://www.nabble.com/Material-Tile-tp17866785p18179023.html
> Sent from the Papervision3D mailing list archive at Nabble.com.
>
>
> _______________________________________________
> Papervision3D mailing list
> Papervision3D at osflash.org
> http://osflash.org/mailman/listinfo/papervision3d_osflash.org
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://osflash.org/pipermail/papervision3d_osflash.org/attachments/20080630/d4f86648/attachment.html
More information about the Papervision3D
mailing list