[Papervision3D] newbie question
Spiros Gerokostas
sger_error at hotmail.com
Mon Feb 19 09:02:32 EST 2007
Thanks Carlos, John
added this line of code into my Main.as _node = _scene.addChild(new
DisplayObject3D("node"));
i want to port HelloCollada project from AS2 to AS3 but flash 9 preview
doesnt support some features from the flex environment like embed tag or new
BitmapAssetMaterial.
am i wrong?
Thanks Spiros Gerokostas
>From: "Carlos Ulloa" <c4rl054321 at gmail.com>
>Reply-To: Papervision3D at osflash.org
>To: Papervision3D at osflash.org
>Subject: Re: [Papervision3D] newbie question
>Date: Mon, 19 Feb 2007 11:31:10 +0000
>
>With the very latest revision, all primitive objects are DisplayObject3D
>and
>you can access their properties before addChild them to the scene.
>
>The traces are not errors. They just mean you have created a
>DisplayObject3D
>with null name.
>
>When things don't appear on screen, there's a few things you can try:
>
>First trace( scene.stats.rendered ) to see if there's anything being
>rendered at all.
>
>If you are getting zeros, then there might be a problem creating the
>object,
>normally loading or parsing.
>
>If the stats show any activity, then the material might be broken of the
>object too small, too far or out of the view of the camera.
>
>Fortunately, Mr Grden is working on a stand alone previewer that would make
>life much easier for everybody.
>
>C4RL05
>// noventaynueve.com
>// papervision3d.org
>
>
>
>On 19/02/07, John Grden <neoriley at gmail.com> wrote:
>>
>>I think your problem is here:
>>
>> _sphere.rotationX = 45;
>> _scene.addChild(_sphere);
>>
>>
>>You need to add to scene before you have access to the DisplayObject3D
>>object to do rotation
>>
>>var displayObj:DisplayObject3D = _scene.addChild(_sphere);
>>displayObj.rotationX = 45;
>>
>>that should do it.
>>
>>Also, instead of using rotationX, you might try pitch() instead.
>>
>>hth,
>>
>>John
>>
>>On 2/18/07, no name <sger_error at hotmail.com> wrote:
>> >
>> > hello to the papervision3D community
>> >
>> > anyone can help me with my simple code i'm using flash 9 preview.
>> >
>> > i'm getting 2 trace errors
>> >
>> > DisplayObject3D: null
>> > DisplayObject3D: null
>> >
>> > package gr.synchronized.papervision3d{
>> >
>> > import flash.display.Sprite;
>> > import flash.display.BitmapData;
>> > import flash.display.Bitmap;
>> > import flash.geom.Matrix;
>> > import flash.display.Loader ;
>> > import flash.events.Event;
>> > import flash.net.URLRequest;
>> >
>> > import org.papervision3d.cameras.FreeCamera3D;
>> > import org.papervision3d.materials.BitmapMaterial;
>> > import org.papervision3d.objects.Ase;
>> > import org.papervision3d.scenes.Scene3D;
>> >
>> > public class Main extends Sprite{
>> >
>> > private var _container:Sprite;
>> > private var _loader:Loader;
>> > private var _bitmap:Bitmap;
>> > private var _bitmapData:BitmapData;
>> > private var _scene:Scene3D;
>> > private var _camera:FreeCamera3D;
>> > private var _material:BitmapMaterial;
>> > private var _sphere:Ase;
>> >
>> > public function Main(){
>> >
>> > _container = new Sprite();
>> > addChild(_container);
>> >
>> > _scene = new Scene3D(_container);
>> > _camera = new FreeCamera3D();
>> >
>> > _loader = new Loader();
>> > _loader.contentLoaderInfo.addEventListener(
>> > Event.COMPLETE, onComplete);
>> > _loader.load(new URLRequest(" image.jpg"));
>> > }
>> >
>> > private function onComplete(event:Event):void{
>> > var loader:Loader =
>>Loader(event.target.loader);
>> > var image:Bitmap = Bitmap(_loader.content);
>> > _bitmapData = new BitmapData(image.width,
>> > image.height, true, 0xFFFFFF);
>> > _bitmapData.draw(image, new Matrix());
>> > var temp:Bitmap = new Bitmap(_bitmapData,
>> > "auto", true);
>> > addChild(temp);
>> > _material = new BitmapMaterial(_bitmapData);
>> > _material.oneSide = true;
>> > _sphere = new Ase(_material, " world.ase", .2);
>> > _sphere.rotationX = 45;
>> > _scene.addChild(_sphere);
>> > }
>> >
>> >
>> >
>> > }
>> >
>> >
>> >
>> > }
>> >
>> > _________________________________________________________________
>> > Express yourself instantly with MSN Messenger! Download today it's
>>FREE!
>> > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/
>> >
>> >
>> > _______________________________________________
>> > Papervision3D mailing list
>> > Papervision3D at osflash.org
>> > http://osflash.org/mailman/listinfo/papervision3d_osflash.org
>> >
>>
>>
>>
>>--
>>[ JPG ]
>>_______________________________________________
>>Papervision3D mailing list
>>Papervision3D at osflash.org
>>http://osflash.org/mailman/listinfo/papervision3d_osflash.org
>>
>>
>_______________________________________________
>Papervision3D mailing list
>Papervision3D at osflash.org
>http://osflash.org/mailman/listinfo/papervision3d_osflash.org
_________________________________________________________________
Express yourself instantly with MSN Messenger! Download today it's FREE!
http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/
More information about the Papervision3D
mailing list