【问题标题】:Libgdx special effects in 3DLibgdx 3D 特效
【发布时间】:2015-11-17 20:07:13
【问题描述】:

我正在尝试不同的 libgdx 功能来开发适用于 android 的 3D 游戏,因为它可以很好地加载 3D 模型并在其上执行动画。现在最大的问题是我发现它很难产生复杂的 3D 效果,如射击、火焰等。没有它们,它看起来就不真实。我知道粒子编辑器,但我正在使用无法正常工作的 ubuntu 14 系统。

我已使用此页面中的“粒子系统”作为基本效果libgdx 3d particle effect

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

【问题讨论】:

  • 使用粒子编辑器是指您发布的链接中提到的“火焰”吗?您确定它在 ubuntu 14 上不起作用吗?除了ParticeEffects,Shaders 可以用来制作一些“眼睛糖果”,如果你想用 libgdx 制作一个 3D 游戏,你绝对应该使用一些 GLSL 着色器。

标签: android libgdx


【解决方案1】:

我最近发了a class particle management,也许对你有帮助

要使用这个:

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

【讨论】:

    猜你喜欢
    • 2014-10-01
    • 1970-01-01
    • 2014-03-13
    • 1970-01-01
    • 1970-01-01
    • 2014-07-28
    • 2014-12-04
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多