在3D Libgdx特效 [英] Libgdx special effects in 3D

查看:560
本文介绍了在3D Libgdx特效的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试不同的libgdx功能开发3D游戏为Android,因为它的工作原理很细高达加载3D模型并对其进行动画。现在的大问题,我发现它很难产生像射击,火灾等。如果没有他们就不会看起来很真实复杂的3D效果。我是知道的粒子编辑器,但我的工作在Ubuntu 14系统,它不能正常工作。

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.

我已经使用了粒子系统通过此页面为基本效果 libgdx 3D粒子效果

I have used 'particle system' from this page for basic effects libgdx 3d particle effect

因此​​,任何想法? 如果你有一些示例code /库/工具,那么请把它放在这里。 谢谢你。

So any ideas? If you have got some sample code/library/tool then please put it here. Thanks.

推荐答案

我最近交的一类粒子的管理,也许这能帮助你

I recently post a class particle management, maybe this can help you

要使用这样的:

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();

这篇关于在3D Libgdx特效的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆