[Solved] Sprite3d doesn’t appear in the scene

Software: Away3D 4.x

Jack Dracon, Newbie
Posted: 18 October 2011 01:14 PM   Total Posts: 27

Hi everybody,
So, I am a little confused with sprite3D.
First of all, I am using the last update of Away3D on the week.
So, I am trying to add a Sprite3D on the scene, but, hasn’t worked.
Here is the code:

var matHero:BitmapMaterial = new BitmapMaterial(new heroImage().bitmapData);
spriteTest = new Sprite3D(matHero128128);
//_view.scene.addChild(spriteTest);
_view.scene.addChild(spriteTest as ObjectContainer3D); 

The material is a png file.
So, I would like to know what I am missing? Or if I will have to do more things?

Thanks for your attention, and have a nice day. =D

   

Somokon, Member
Posted: 18 October 2011 05:52 PM   Total Posts: 75   [ # 1 ]

Is there a reason you are casting it to an ObjectContainer3D?  I don’t think you should be doing that.

   

Jack Dracon, Newbie
Posted: 18 October 2011 07:14 PM   Total Posts: 27   [ # 2 ]

Hi,
So, was just a test to force the load, since the Sprite3D doesn’t work.
Thanks for advice, Somokon. ;D
Any other idea?

   

Somokon, Member
Posted: 18 October 2011 08:01 PM   Total Posts: 75   [ # 3 ]

Hmm, maybe check if your BitmapMaterial is loading properly?

If you do

cube = new Cube(matHero)
view.scene.addChild(cube)

is the cube textured properly?

   

Jack Dracon, Newbie
Posted: 19 October 2011 11:32 AM   Total Posts: 27   [ # 4 ]

Hi, I tried in a Plane, and worked. Could be considered as working fine with primitives. I will try to do something with displacement of the sprite 3d, may be this helps.
But, still open for advices. wink
Thanks.

   

sargon, Member
Posted: 19 October 2011 11:35 AM   Total Posts: 51   [ # 5 ]

do you debug your project ?
if not download http://www.adobe.com/support/flashplayer/downloads.html debuger of FP11.

open your swf by debuger and if there are any problems with loading any thing adding to scene anything debbuger will trace it.

   

Jack Dracon, Newbie
Posted: 19 October 2011 12:13 PM   Total Posts: 27   [ # 6 ]

Hi there, now my problem is fixed. =D
My problem was the position and rotation of the sprite. =\
The rotation property now, is diferent, becareful with this. wink
So, that’s the code:

var matPlane:BitmapMaterial = new BitmapMaterial(new  heroImage().bitmapData);
matPlane.alphaBlending true;
spriteHero = new Sprite3D(matPlane55);
spriteHero.4;
spriteHero.21;
spriteHero.rotationX 90

Thanks again for the advice and I hope that can help in the future.

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X