native particle effect in Away3d? How to apply a bitmapdata material to a sprite3d object? I just want use a part of the bitmapdata.

Software: Away3D 4.x

liuyi, Member
Posted: 30 August 2011 10:55 AM   Total Posts: 65

Hi guys,

I have a question:
How to apply a bitmapdata material to a Sprite3d object? I just want use a part of the BitmapData.
Because I want do a UV animation like fire.

Please see the picture.

In fact, I want do a flame effect.
I have tried Flint particle system (v4 away3d), but it’s very slowly.

And I found some guys do the particle effect very well.
see:http://docs.google.com/viewer?a=v&q=cache:Q6SHS4PgY9oJ:molehill.zombietycoon.com/FGSZombieNoVideos.pptx+zombietycoon+particle&hl=zh-CN&pid=bl&srcid=ADGEEShAbZavmr00WJuLhvL10cB-Tt5kiD27aIcVbdIywZz5mnMxiJ1yNBCM2M2flFlrRsH34LwHKQtuvv7PZVRddlaTylfYUQbB-NmXmA90KZYe4Earw6yGmsAQ0CyRMqjDNk99pmuq&sig=AHIEtbQb3ZchE-2KC1gaoTRZQdH-0Q2n4w&pli=1

and here: http://www.mcfunkypants.com/molehill/particles/

I want do it in away3d, but have no idea now.

Help~~~

Thanks all!

 

   

liuyi, Member
Posted: 31 August 2011 10:19 AM   Total Posts: 65   [ # 1 ]

Can somebody help me?

   

Avatar
Apprentice, Jr. Member
Posted: 07 September 2011 07:33 AM   Total Posts: 45   [ # 2 ]

Hmm I’m now looking to do this as well, but I don’t think you can set UV coordinates on a Sprite3D (it’s geometry is private). I’d also like my Sprite3D to be able to rotate (adds some effect to the particle), but I don’t think I can currently do this.

Instead I’m using a Plane and making it look at the camera (though I suspect using a lookAt for every particle every frame is a bit too expensive and I will change it to setting the rotation of the particle equal to the rotation of the camera). Then after X frames (for you maybe each frame) update the UV coordinates. I’m doing this using:

var uvs:Vector.<Number> = new <Number>[X,1.0  ,  (X+.125),1.0  ,  X,0.0  ,  (X+.125),0.0];
plane.geometry.subGeometries[0].updateUVData(uvs);  // x+ y- 

Where X is between 0 and 0.875
So for me this an animation of 8 frames (the image is 1024x128: 8 images of 128x128 next to each other). Using your image you’d have to adjust the UV coordinates.

I am wondering though if this is the best way to update the UV coordinates. I don’t really like using an entire new vector to update the UVs, all I need is to update the current vector of UVs, but if I do that I’ll have to invalidate the UVs as well as Away3D won’t know I changed them, which seems a bit hacky on my part.
Does anyone else have advice on this?

—Apprentice

   

John Brookes, Moderator
Posted: 07 September 2011 08:41 AM   Total Posts: 732   [ # 3 ]

Try AnimatedBitmapMaterial
Instead of a sprite sheet you pass few images.

   

Avatar
Apprentice, Jr. Member
Posted: 07 September 2011 09:31 AM   Total Posts: 45   [ # 4 ]

Isn’t that great if all your particles show exactly the same animation? But if you want particles which can be in different stages of the animation, you’d need multiple materials, right? And multiple materials is bad for the performance as I understood from David’s blog post.

—Apprentice

   

Fab4ce, Jr. Member
Posted: 19 March 2012 04:02 PM   Total Posts: 44   [ # 5 ]

AnimatedBitmapMaterial doesn´t exist…anymore?
Is there a solution for bitmapdata material on a sprite3d?
i tried:
var mat1:TextureMaterial = new TextureMaterial(new BitmapTexture(mcBitmapData));
var mat2:BitmapMaterial = new BitmapMaterial(mcBitmapData);

Both are not visible in my scene.
Should it work with these?
(For testing i used Colormaterial too and it´s doing the job)

   

Fab4ce, Jr. Member
Posted: 19 March 2012 04:16 PM   Total Posts: 44   [ # 6 ]

ok…i found the problem. My bitmapdata wasn´t one of these 512x512 power of 2 formats.

Anyway, is an AnimatedBitmapMaterial planed?

   

inSertCodE, Sr. Member
Posted: 19 March 2012 04:58 PM   Total Posts: 105   [ # 7 ]

If you are talking about liaocheng’s particle system it already has those futures implemented. He implemented them in less than a day when I suggested them as a future. (great guy wink )

See pages 3 and 4

http://away3d (dot) com/forum/viewthread/962/P30

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X