问题
I am trying different libgdx features to develop a 3D game for android, as it works very fine upto loading 3D models and perform animations on them. Now the big problem i found that its difficult to produce complex 3D effects like shooting, fire etc. Without them it won't look real. I know about particle editor but I am working on ubuntu 14 system where its not working properly.
I have used 'particle system' from this page for basic effects libgdx 3d particle effect
So any ideas? If you have got some sample code/library/tool then please put it here. Thanks.
回答1:
I recently post a class particle management, maybe this can help you
To use this :
myParticles = new MyParticles(camera3d);
//load assets
assets.setLoader(ParticleEffect.class, myParticles.loader);
assets.load("particles/explosion1.part", ParticleEffect.class, myParticles.loadParam);
assets.load("particles/explosion2.part", ParticleEffect.class, myParticles.loadParam);
assets.finishLoading();
//load Pooler
HashMap<String, String> particle = new HashMap<String, String>();
particle.put("explosion_small", "particles/explosion1.part");
particle.put("explosion_big", "particles/explosion2.part");
myParticles.loadPool(particle, assets);
particle.clear();
//create particle ( array is better )
exploseSmall = myParticles.createEffect(myParticles.pool.get("explosion_small"));
exploseBig = myParticles.createEffect(myParticles.pool.get("explosion_big"));
//render methode
modelBatch.begin(camera);
myParticles.render();
modelBatch.render(myParticles.particleSystem);
modelBatch.end();
//dispose effect with timer
myParticle.free(exploseSmall, 0.5f);
myParticle.free(exploseBig, 1);
//dispose myparticle system and pooler
myParticle.dispose();
来源:https://stackoverflow.com/questions/26887570/libgdx-special-effects-in-3d