[Papervision3D] For loop to create various planes

Joseph Curtin daJo3y at gmail.com
Wed Apr 23 13:31:32 PDT 2008


lucky for you, i was playing with this today. :P Its not all there, its only
a method, however it illustrates how to make what you requested.

 var floorL:uint=10;
            var floorW:uint=3;

            container=new DisplayObject3D();
            scene.addChild(container);
            container.scale=5;


            for(var iHeight:uint=0;iHeight<floorL;iHeight++){

                for(var iWidth:uint=0;iWidth<floorW;iWidth++){

                    var bmMat:BitmapColorMaterial=new
BitmapColorMaterial(0xffffff*Math.random(),Math.random());
                    bmMat.doubleSided=true;

                    var plane:Plane=new Plane(bmMat,100,250,2,2);

                    plane.x=100*iWidth-50;
                    plane.y=250*iHeight-125;
                    plane.z=0;

                    container.addChild(plane);



                }
            }

On Wed, Apr 23, 2008 at 4:12 PM, Marcus Vinicius S Oliveira <
kobawsky at gmail.com> wrote:

> Hello all,
>
> A simple basic question, how to do a FOR loop to create 25 planes like
> this (using AS3 + PV3D v2):
>
> var plano1:DisplayObject3D = chao.addChild( new Plane( material2, 400,
> 400), "plano1" );
> var plano2:DisplayObject3D = chao.addChild( new Plane( material2, 400,
> 400), "plano2" );
> var plano3:DisplayObject3D = chao.addChild( new Plane( material2, 400,
> 400), "plano3" );
> ...
>
> thanks
>
> --
> Envolva-se
> www.envolveweb.com.br
>
> Portfólio
> www.envolveweb.com.br/marcus
>
> 3D Engine for Flash
> blog.papervision3D.org
>
> Papervision3D Mailing list
> osflash.org/papervision3d
> _______________________________________________
> Papervision3D mailing list
> Papervision3D at osflash.org
> http://osflash.org/mailman/listinfo/papervision3d_osflash.org
>
>


-- 
-Joe
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://osflash.org/pipermail/papervision3d_osflash.org/attachments/20080423/35833a27/attachment.html 


More information about the Papervision3D mailing list