Libgdx special effects in 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 特效
基础教程推荐
- 在 gmail 中为 ios 应用程序检索朋友的朋友 2022-01-01
- 如何在 UIImageView 中异步加载图像? 2022-01-01
- 如何在 iPhone 上显示来自 API 的 HTML 文本? 2022-01-01
- android 应用程序已发布,但在 google play 中找不到 2022-01-01
- UIWebView 委托方法 shouldStartLoadWithRequest:在 WKWebView 中等效? 2022-01-01
- Kivy Buildozer 无法构建 apk,命令失败:./distribute.sh -m “kivy"d 2022-01-01
- 如何让对象对 Cocos2D 中的触摸做出反应? 2022-01-01
- Android:对话框关闭而不调用关闭 2022-01-01
- 当从同一个组件调用时,两个 IBAction 触发的顺序是什么? 2022-01-01
- 如何在没有IB的情况下将2个按钮添加到右侧的UINavigationbar? 2022-01-01