[Papervision3D] creating models and texturing with 3DS

John Grden neoriley at gmail.com
Fri Dec 22 21:48:12 EST 2006


Here's a snippet of what I did for a flex2 app with PV3D:
// in the declarations:

private var videoHolder:UIComponent = new UIComponent();
private var videoPlayer:Video;

private function init()
{
                videoHolder.setActualSize(360, 240);

                // create the video object and set it's initial size
                videoPlayer = new Video(360,240);

                nc = new NetConnection();
                nc.connect(null);
                ns = new NetStream(nc);
                ns.addEventListener("netStatus", handleNetStatus);
                videoPlayer.attachNetStream(ns);

                ns.client = this;
                ns.play("videos/matrix.flv");



                // add the video object to the UIComponent
                videoHolder.addChild(videoPlayer);

                // add the UIComponent to the Panel
                this.addChild(videoHolder);
            }

            private function handleNetStatus(e:NetStatusEvent):void
            {
                log.debug("NetStatus", e.info);
                if(e.info.code == "NetStream.Play.Stop")
                {
                    ns.seek(0);
                }
            }

            public function onMetaData(info:Object):void
            {
                if(metaData.width!=undefined) return;
                metaData = info;

                videoPlayer.width = metaData.width;
                videoPlayer.height = metaData.height;

                videoHolder.x=-1000;

                // matrix material
                matrixMaterial = new Material3D(videoPlayer, 0x00ff00,0,
null, null,true, false );
                matrixMaterial.oneSide = false;
            }

I think that's what you're after

hth,

John

On 12/22/06, ricardo cabello ! mr.doob <info at mrdoob.com> wrote:
>
> Hey John,
>
> I'm still fighting with the FLV thingie. Right now I'm testing and
> testing but I don't see any way of making it work. I mainly want to loop
> a video.
>
> I've checked the examples and google and stuff and I saw that you need
> to put a method for your CustomClient Class... something like:
>
> public function onPlayStatus(info:Object):void
> {
>     if(info.code=="NetStream.Play.Complete")ns.seek(0);
> }
>
> But it never executes that. Is there any other way to make the
> Actionscript loop a FLV?
>
> Thanks a lot!
> --
> ricardo cabello
> http://mrdoob.com
>
> John Grden wrote:
> > yeah, you can use FLV's for a material.  If you look at the other blog
> > entry I have, it's using an FLV to texture the tiefighter.  I've done
> > it in as2 and as3.  AS2 it was embedded in the library, and AS3, I
> > played it over NetStream.  All you have to do is add the material to
> > the scene so that it updates the draw.
> >
> > I think that you hit it on the head:  ASE importer, and collada for
> > that matter, don't support multiple objects yet.
> >
> > Is that accurate Carlos?
> >
> > On 12/22/06, * ricardo cabello ! mr.doob* <info at mrdoob.com
> > <mailto:info at mrdoob.com>> wrote:
> >
> >     Nice one John!
> >
> >     How come PV3D still has the limitation of only one object? Doesn't
> the
> >     Scene3D fixes this? Or is it that the ASE importer isn't updated to
> >     support this yet?
> >
> >     Also, I'm doing some tests... Is it possible to use a .FLV as
> >     material?
> >
> >     Cheers!
> >     --
> >     ricardo cabello
> >     http://mrdoob.com
> >
> >     John Grden wrote:
> >     > I finally finished my first test with 3DS and texturing for use in
> >     > PV3D.  I went ahead and blogged an overview along with
> >     screenshots of
> >     > some of the processes.  I also included a link that was
> >     tremendous in
> >     > getting me up and running with texture mapping in 3DS.
> >     >
> >     > Anyway, the result was a decent looking low-poly Xwing model
> >     exported
> >     > as an ASE model and rendered with PV3D
> >     >
> >     > http://www.rockonflash.com/blog/?p=30
> >     >
> >     > would love comments
> >     >
> >     > Thanks all,
> >     >
> >     >
> >     > --
> >     > [  JPG  ]
> >     >
> >
> ------------------------------------------------------------------------
> >     >
> >     > _______________________________________________
> >     > Papervision3D mailing list
> >     > Papervision3D at osflash.org <mailto:Papervision3D at osflash.org>
> >     > http://osflash.org/mailman/listinfo/papervision3d_osflash.org
> >     <http://osflash.org/mailman/listinfo/papervision3d_osflash.org>
> >     >
> >
> >
> >
> >
> > --
> > [  JPG  ]
>



-- 
[  JPG  ]
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://osflash.org/pipermail/papervision3d_osflash.org/attachments/20061222/d87a4a76/attachment.htm


More information about the Papervision3D mailing list