Libgdx 3D 特效

Libgdx special effects in 3D(Libgdx 3D 特效)

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

问题描述

我正在尝试不同的 libgdx 功能来开发适用于 android 的 3D 游戏,因为它可以很好地加载 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

所以有什么想法吗?如果您有一些示例代码/库/工具,请把它放在这里.谢谢.

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

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

本文标题为:Libgdx 3D 特效

基础教程推荐