Animated Texures / Sprites

Hello,

I’m entirely new to jme3, therefore i don’t know much about it yet. Furthermore this is the first 3D engine I’m using.
I want to program a game using animated sprites. I read many articles about it in this forum, but couldn’t get it right for me.

  1. Using the particle emitter: Only solution i could get done, but you cant move the particles, so the “sprite” wouldn’t move.
  2. Using shaders: I’m new to 3D programming, shaders etc., so I didn’t unterstand this approach. (like here “http://hub.jmonkeyengine.org/forum/topic/animated-2d-sprites/”)

I guess using shaders is the right way, but I just couldn’t get it right. So could anyone explain this to me or send me a link to smth i missed?

Well the most basic and simple way is to use a quad and just exchange the amterial every x frames.

Thank you. I did it and it works fine. But atm i load all frames of a sprite separate. I searched a little but didn’t find how to create multiple texture out of one image file?

if you only have like 100 spirtes at max would just keep it that way, since it wouldnt be to much a performance break. Else you can use a textureatlas, but the you also must use a custom shader / modify texture coordiantes ect.

I’m sure I saw a sprite library posted to these forums a while back. Try searching for it.

@revan954761 said: Hello,

I’m entirely new to jme3, therefore i don’t know much about it yet. Furthermore this is the first 3D engine I’m using.
I want to program a game using animated sprites. I read many articles about it in this forum, but couldn’t get it right for me.

  1. Using the particle emitter: Only solution i could get done, but you cant move the particles, so the “sprite” wouldn’t move.
  2. Using shaders: I’m new to 3D programming, shaders etc., so I didn’t unterstand this approach. (like here “http://hub.jmonkeyengine.org/forum/topic/animated-2d-sprites/”)

I guess using shaders is the right way, but I just couldn’t get it right. So could anyone explain this to me or send me a link to smth i missed?

There are some shaders for you. SimpleSprite Particle shader, SimpleSprite shader.
Google Code Archive - Long-term storage for Google Code Project Hosting. - unofficial lib
Google Code Archive - Long-term storage for Google Code Project Hosting. - official lib.