| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143 |
- <!DOCTYPE html><html lang="en"><head><meta charset="UTF-8"><!--[if IE]><meta http-equiv="X-UA-Compatible" content="IE=edge"><![endif]--><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="Asciidoctor 1.5.4"><meta name="keywords" content="beginner, documentation, intro, transparency, effect"><title>jMonkeyEngine 3 Tutorial (12) - Hello Effects</title><link rel="stylesheet" href="./asciidoctor.css">
- <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.5.0/css/font-awesome.min.css">
- <link rel="stylesheet" href="./coderay-asciidoctor.css"><link rel="stylesheet" href="https://cdn.jsdelivr.net/docsearch.js/2/docsearch.min.css"><link rel="stylesheet" href="/home/travis/build/jMonkeyEngine/wiki/build/asciidoc/html5/jme3/beginner/twemoji-awesome.css"></head><body class="article toc2 toc-left"><div id="header"><div id="toolbar"><a href="https://github.com/jMonkeyEngine/wiki/edit/master/src/docs/asciidoc/jme3/beginner/hello_effects.adoc"><i class="fa fa-pencil-square" aria-hidden="true"></i></a><a href="https://github.com/jMonkeyEngine/wiki/new/master/src/docs/asciidoc/jme3/beginner/"><i class="fa fa-plus-square" aria-hidden="true"></i></a><input dir="auto" style="position: relative; vertical-align: top;" spellcheck="false" autocomplete="off" class="searchbox__input aa-input" id="doc-search" name="search" placeholder="Search in the doc" required="required" type="search"></div><h1>jMonkeyEngine 3 Tutorial (12) - Hello Effects</h1><div class="details"><span class="author" id="author"></span><br><span id="revnumber">version ,</span> <span id="revdate">2016/03/17 20:48</span></div><div id="toc" class="toc2"><div id="toctitle">Table of Contents</div><ul class="sectlevel1"><li><a href="#sample-code">Sample Code</a><ul class="sectlevel2"><li><a href="#texture-animation-and-variation">Texture Animation and Variation</a></li><li><a href="#default-particle-textures">Default Particle Textures</a></li></ul></li><li><a href="#creating-custom-textures">Creating Custom Textures</a><ul class="sectlevel2"><li><a href="#emitter-parameters">Emitter Parameters</a></li></ul></li><li><a href="#exercise">Exercise</a></li><li><a href="#conclusion">Conclusion</a></li></ul></div></div><div id="content"><div id="preamble"><div class="sectionbody"><div class="paragraph"><p>Previous: <a href="../../jme3/beginner/hello_audio.html">Hello Audio</a>,
- Next: <a href="../../jme3/beginner/hello_physics.html">Hello Physics</a></p></div>
- <div class="imageblock right"><div class="content"><img src="../../jme3/beginner/beginner-effect-fire.png" alt="beginner-effect-fire.png" width="150" height="165"></div></div>
- <div class="paragraph"><p>When you see one of the following in a game, then a particle system is likely behind it:</p></div>
- <div class="ulist"><ul><li><p>Fire, flames, sparks;</p></li><li><p>Rain, snow, waterfalls, leaves;</p></li><li><p>Explosions, debris, shockwaves;</p></li><li><p>Dust, fog, clouds, smoke;</p></li><li><p>Insects swarms, meteor showers;</p></li><li><p>Magic spells.</p></li></ul></div>
- <div class="paragraph"><p>These scene elements cannot be modeled by meshes. In very simple terms:</p></div>
- <div class="ulist"><ul><li><p>The difference between an explosion and a dust cloud is the speed of the particle effect.</p></li><li><p>The difference between flames and a waterfall is the direction and the color of the particle effect.</p></li></ul></div>
- <div class="paragraph"><p>Particle effects can be animated (e.g. sparks, drops) and static (strands of grass, hair). Non-particle effects include bloom/glow, and motion blur/afterimage. In this tutorial you learn how to make animated particles (com.jme3.effect).</p></div>
- <div class="admonitionblock tip"><table><tr><td class="icon"><i class="fa icon-tip" title="Tip"></i></td><td class="content"><div class="paragraph"><p>To use the example assets in a new jMonkeyEngine SDK project, <b class="button">RMB</b> click your project, select <span class="menuseq"><span class="menu">Properties</span> ▸ <span class="submenu">Libraries</span> ▸ <span class="menuitem">Add Library</span></span> and add the “jme3-test-data” library.</p></div></td></tr></table></div></div></div>
- <div class="sect2"><h3 id="sample-code">Sample Code</h3><div class="listingblock"><div class="content"><pre class="CodeRay highlight"><code data-lang="java"><span class="keyword">package</span> <span class="namespace">jme3test.helloworld</span>;
- <span class="keyword">import</span> <span class="include">com.jme3.app.SimpleApplication</span>;
- <span class="keyword">import</span> <span class="include">com.jme3.effect.ParticleEmitter</span>;
- <span class="keyword">import</span> <span class="include">com.jme3.effect.ParticleMesh</span>;
- <span class="keyword">import</span> <span class="include">com.jme3.material.Material</span>;
- <span class="keyword">import</span> <span class="include">com.jme3.math.ColorRGBA</span>;
- <span class="keyword">import</span> <span class="include">com.jme3.math.Vector3f</span>;
- <span class="comment">/** Sample 11 - how to create fire, water, and explosion effects. */</span>
- <span class="directive">public</span> <span class="type">class</span> <span class="class">HelloEffects</span> <span class="directive">extends</span> SimpleApplication {
- <span class="directive">public</span> <span class="directive">static</span> <span class="type">void</span> main(<span class="predefined-type">String</span><span class="type">[]</span> args) {
- HelloEffects app = <span class="keyword">new</span> HelloEffects();
- app.start();
- }
- <span class="annotation">@Override</span>
- <span class="directive">public</span> <span class="type">void</span> simpleInitApp() {
- ParticleEmitter fire =
- <span class="keyword">new</span> ParticleEmitter(<span class="string"><span class="delimiter">"</span><span class="content">Emitter</span><span class="delimiter">"</span></span>, ParticleMesh.Type.Triangle, <span class="integer">30</span>);
- Material mat_red = <span class="keyword">new</span> Material(assetManager,
- <span class="string"><span class="delimiter">"</span><span class="content">Common/MatDefs/Misc/Particle.j3md</span><span class="delimiter">"</span></span>);
- mat_red.setTexture(<span class="string"><span class="delimiter">"</span><span class="content">Texture</span><span class="delimiter">"</span></span>, assetManager.loadTexture(
- <span class="string"><span class="delimiter">"</span><span class="content">Effects/Explosion/flame.png</span><span class="delimiter">"</span></span>));
- fire.setMaterial(mat_red);
- fire.setImagesX(<span class="integer">2</span>);
- fire.setImagesY(<span class="integer">2</span>); <span class="comment">// 2x2 texture animation</span>
- fire.setEndColor( <span class="keyword">new</span> ColorRGBA(<span class="float">1f</span>, <span class="float">0f</span>, <span class="float">0f</span>, <span class="float">1f</span>)); <span class="comment">// red</span>
- fire.setStartColor(<span class="keyword">new</span> ColorRGBA(<span class="float">1f</span>, <span class="float">1f</span>, <span class="float">0f</span>, <span class="float">0.5f</span>)); <span class="comment">// yellow</span>
- fire.getParticleInfluencer().setInitialVelocity(<span class="keyword">new</span> Vector3f(<span class="integer">0</span>, <span class="integer">2</span>, <span class="integer">0</span>));
- fire.setStartSize(<span class="float">1.5f</span>);
- fire.setEndSize(<span class="float">0.1f</span>);
- fire.setGravity(<span class="integer">0</span>, <span class="integer">0</span>, <span class="integer">0</span>);
- fire.setLowLife(<span class="float">1f</span>);
- fire.setHighLife(<span class="float">3f</span>);
- fire.getParticleInfluencer().setVelocityVariation(<span class="float">0.3f</span>);
- rootNode.attachChild(fire);
- ParticleEmitter debris =
- <span class="keyword">new</span> ParticleEmitter(<span class="string"><span class="delimiter">"</span><span class="content">Debris</span><span class="delimiter">"</span></span>, ParticleMesh.Type.Triangle, <span class="integer">10</span>);
- Material debris_mat = <span class="keyword">new</span> Material(assetManager,
- <span class="string"><span class="delimiter">"</span><span class="content">Common/MatDefs/Misc/Particle.j3md</span><span class="delimiter">"</span></span>);
- debris_mat.setTexture(<span class="string"><span class="delimiter">"</span><span class="content">Texture</span><span class="delimiter">"</span></span>, assetManager.loadTexture(
- <span class="string"><span class="delimiter">"</span><span class="content">Effects/Explosion/Debris.png</span><span class="delimiter">"</span></span>));
- debris.setMaterial(debris_mat);
- debris.setImagesX(<span class="integer">3</span>);
- debris.setImagesY(<span class="integer">3</span>); <span class="comment">// 3x3 texture animation</span>
- debris.setRotateSpeed(<span class="integer">4</span>);
- debris.setSelectRandomImage(<span class="predefined-constant">true</span>);
- debris.getParticleInfluencer().setInitialVelocity(<span class="keyword">new</span> Vector3f(<span class="integer">0</span>, <span class="integer">4</span>, <span class="integer">0</span>));
- debris.setStartColor(ColorRGBA.White);
- debris.setGravity(<span class="integer">0</span>, <span class="integer">6</span>, <span class="integer">0</span>);
- debris.getParticleInfluencer().setVelocityVariation(<span class="float">.60f</span>);
- rootNode.attachChild(debris);
- debris.emitAllParticles();
- }
- }</code></pre></div></div>
- <div class="paragraph"><p>You should see an explosion that sends debris flying, and a fire.
- <a href="https://github.com/jMonkeyEngine/jmonkeyengine/tree/master/jme3-examples/src/main/java/jme3test/effect">More example code is here.</a></p></div>
- <div class="sect2"><h3 id="texture-animation-and-variation">Texture Animation and Variation</h3><div class="imageblock right"><div class="content"><img src="../../jme3/beginner/Debris.png" alt="Debris.png" width="96" height="96"></div></div>
- <div class="paragraph"><p>Start by choosing a material texture for your effect. If you provide the emitter with a set of textures (see image), it can use them either for variation (random order), or as animation steps (fixed order).</p></div>
- <div class="paragraph"><p>Setting emitter textures works just as you have already learned in previous chapters. This time you base the material on the <code>Particle.j3md</code> material definition. Let’s have a closer look at the material for the Debris effect.</p></div>
- <div class="listingblock"><div class="content"><pre class="CodeRay highlight"><code data-lang="java"> ParticleEmitter debris =
- <span class="keyword">new</span> ParticleEmitter(<span class="string"><span class="delimiter">"</span><span class="content">Debris</span><span class="delimiter">"</span></span>, ParticleMesh.Type.Triangle, <span class="integer">10</span>);
- Material debris_mat = <span class="keyword">new</span> Material(assetManager,
- <span class="string"><span class="delimiter">"</span><span class="content">Common/MatDefs/Misc/Particle.j3md</span><span class="delimiter">"</span></span>);
- debris_mat.setTexture(<span class="string"><span class="delimiter">"</span><span class="content">Texture</span><span class="delimiter">"</span></span>, assetManager.loadTexture(
- <span class="string"><span class="delimiter">"</span><span class="content">Effects/Explosion/Debris.png</span><span class="delimiter">"</span></span>));
- debris.setMaterial(debris_mat);
- debris.setImagesX(<span class="integer">3</span>);
- debris.setImagesY(<span class="integer">3</span>); <span class="comment">// 3x3 texture animation</span>
- debris.setSelectRandomImage(<span class="predefined-constant">true</span>);
- ...</code></pre></div></div>
- <div class="olist arabic"><ol class="arabic"><li><p>Create a material and load the texture.</p></li><li><p>Tell the Emitter into how many animation steps (x*y) the texture is divided.<br>
- The debris texture has 3x3 frames.</p></li><li><p>Optionally, tell the Emitter whether the animation steps are to be at random, or in order.<br>
- For the debris, the frames play at random.</p></li></ol></div>
- <div class="paragraph"><p>As you see in the debris example, texture animations improve effects because each “flame” or “piece” of debris now looks different. Also think of electric or magic effects, where you can create very interesting animations by using an ordered morphing series of lightning bolts; or flying leaves or snow flakes, for instance.</p></div>
- <div class="paragraph"><p>The fire material is created the same way, just using “Effects/Explosion/flame.png” texture, which has with 2x2 ordered animation steps.</p></div></div>
- <div class="sect2"><h3 id="default-particle-textures">Default Particle Textures</h3><div class="paragraph"><p>The following particle textures included in <code>test-data.jar</code>. You can copy and use them in your own effects.</p></div>
- <table class="tableblock frame-all grid-all spread"><colgroup><col style="width: 33.3333%;"><col style="width: 33.3333%;"><col style="width: 33.3334%;"></colgroup><thead><tr><th class="tableblock halign-left valign-top">Texture Path</th><th class="tableblock halign-left valign-top">Dimension</th><th class="tableblock halign-left valign-top">Preview</th></tr></thead><tbody><tr><td class="tableblock halign-left valign-top"><div><div class="paragraph"><p>Effects/Explosion/Debris.png</p></div></div></td><td class="tableblock halign-left valign-top"><div><div class="paragraph"><p>3*3</p></div></div></td><td class="tableblock halign-left valign-top"><div><div class="paragraph"><p><span class="image"><img src="../../jme3/beginner/Debris.png" alt="Debris.png" width="32" height="32"></span></p></div></div></td></tr><tr><td class="tableblock halign-left valign-top"><div><div class="paragraph"><p>Effects/Explosion/flame.png</p></div></div></td><td class="tableblock halign-left valign-top"><div><div class="paragraph"><p>2*2</p></div></div></td><td class="tableblock halign-left valign-top"><div><div class="paragraph"><p><span class="image"><img src="../../jme3/beginner/flame.png" alt="flame.png" width="32" height="32"></span></p></div></div></td></tr><tr><td class="tableblock halign-left valign-top"><div><div class="paragraph"><p>Effects/Explosion/shockwave.png</p></div></div></td><td class="tableblock halign-left valign-top"><div><div class="paragraph"><p>1*1</p></div></div></td><td class="tableblock halign-left valign-top"><div><div class="paragraph"><p><span class="image"><img src="../../jme3/beginner/shockwave.png" alt="shockwave.png" width="32" height="32"></span></p></div></div></td></tr><tr><td class="tableblock halign-left valign-top"><div><div class="paragraph"><p>Effects/Explosion/smoketrail.png</p></div></div></td><td class="tableblock halign-left valign-top"><div><div class="paragraph"><p>1*3</p></div></div></td><td class="tableblock halign-left valign-top"><div><div class="paragraph"><p><span class="image"><img src="../../jme3/beginner/smoketrail.png" alt="smoketrail.png" width="32" height="32"></span></p></div></div></td></tr><tr><td class="tableblock halign-left valign-top"><div><div class="paragraph"><p>Effects/Smoke/Smoke.png</p></div></div></td><td class="tableblock halign-left valign-top"><div><div class="paragraph"><p>1*15</p></div></div></td><td class="tableblock halign-left valign-top"><div><div class="paragraph"><p><span class="image"><img src="../../jme3/beginner/Smoke.png" alt="Smoke.png" width="96" height="32"></span></p></div></div></td></tr></tbody></table>
- <div class="paragraph"><p>Copy them into your <code>assets/Effects</code> directory to use them.</p></div></div></div>
- <div class="sect2"><h3 id="creating-custom-textures">Creating Custom Textures</h3><div class="paragraph"><p>For your game, you will likely create custom particle textures. Look at the fire example again.</p></div>
- <div class="listingblock"><div class="content"><pre class="CodeRay highlight"><code data-lang="java"> ParticleEmitter fire =
- <span class="keyword">new</span> ParticleEmitter(<span class="string"><span class="delimiter">"</span><span class="content">Emitter</span><span class="delimiter">"</span></span>, ParticleMesh.Type.Triangle, <span class="integer">30</span>);
- Material mat_red = <span class="keyword">new</span> Material(assetManager,
- <span class="string"><span class="delimiter">"</span><span class="content">Common/MatDefs/Misc/Particle.j3md</span><span class="delimiter">"</span></span>);
- mat_red.setTexture(<span class="string"><span class="delimiter">"</span><span class="content">Texture</span><span class="delimiter">"</span></span>, assetManager.loadTexture(
- <span class="string"><span class="delimiter">"</span><span class="content">Effects/Explosion/flame.png</span><span class="delimiter">"</span></span>));
- fire.setMaterial(mat_red);
- fire.setImagesX(<span class="integer">2</span>);
- fire.setImagesY(<span class="integer">2</span>); <span class="comment">// 2x2 texture animation</span>
- fire.setEndColor( <span class="keyword">new</span> ColorRGBA(<span class="float">1f</span>, <span class="float">0f</span>, <span class="float">0f</span>, <span class="float">1f</span>)); <span class="comment">// red</span>
- fire.setStartColor(<span class="keyword">new</span> ColorRGBA(<span class="float">1f</span>, <span class="float">1f</span>, <span class="float">0f</span>, <span class="float">0.5f</span>)); <span class="comment">// yellow</span></code></pre></div></div>
- <div class="imageblock right"><div class="content"><img src="../../jme3/beginner/flame.png" alt="flame.png" width="96" height="96"></div></div>
- <div class="paragraph"><p>Compare the texture with the resulting effect.</p></div>
- <div class="ulist"><ul><li><p>Black parts of the image become fully transparent.</p></li><li><p>White/gray parts of the image are translucent and get colorized.</p></li><li><p>You set the color using <code>setStartColor()</code> and <code>setEndColor()</code>.<br>
- For fire, is’s a gradient from yellow to red.</p></li><li><p>By default, the animation is played in order and loops.</p></li></ul></div>
- <div class="paragraph"><p>Create a grayscale texture in a graphic editor, and save it to your <code>assets/Effects</code> directory. If you split up one image file into x*y animation steps, make sure each square is of equal size–just as you see in the examples here.</p></div>
- <div class="sect2"><h3 id="emitter-parameters">Emitter Parameters</h3><div class="paragraph"><p>A particle system is always centered around an emitter.</p></div>
- <div class="paragraph"><p>Use the <code>setShape()</code> method to change the EmitterShape:</p></div>
- <div class="ulist"><ul><li><p>EmitterPointShape(Vector3f.ZERO) – particles emit from a point (default)</p></li><li><p>EmitterSphereShape(Vector3f.ZERO,2f) – particles emit from a sphere-sized area</p></li><li><p>EmitterBoxShape(new Vector3f(-1f,-1f,-1f),new Vector3f(1f,1f,1f)) – particles emit from a box-sized area</p></li></ul></div>
- <div class="paragraph"><p>Example:</p></div>
- <div class="listingblock"><div class="content"><pre class="CodeRay highlight"><code data-lang="java">emitter.setShape(<span class="keyword">new</span> EmitterPointShape(Vector3f.ZERO));</code></pre></div></div>
- <div class="paragraph"><p>You create different effects by changing the emitter parameters:</p></div>
- <table class="tableblock frame-all grid-all spread"><colgroup><col style="width: 10%;"><col style="width: 50%;"><col style="width: 15%;"><col style="width: 25%;"></colgroup><thead><tr><th class="tableblock halign-left valign-top">Parameter</th><th class="tableblock halign-left valign-top">Method</th><th class="tableblock halign-left valign-top">Default</th><th class="tableblock halign-left valign-top">Description</th></tr></thead><tbody><tr><td class="tableblock halign-left valign-top"><div><div class="paragraph"><p>number</p></div></div></td><td class="tableblock halign-left valign-top"><div><div class="paragraph"><p><code>setNumParticles()</code></p></div></div></td><td class="tableblock halign-left valign-top"><div><div class="paragraph"><p>N/A</p></div></div></td><td class="tableblock halign-left valign-top"><div><div class="paragraph"><p>The maximum number of particles visible at the same time. Value is specified by user in constructor. This influences the density and length of the “trail”.</p></div></div></td></tr><tr><td class="tableblock halign-left valign-top"><div><div class="paragraph"><p>velocity</p></div></div></td><td class="tableblock halign-left valign-top"><div><div class="paragraph"><p><code>getParticleInfluencer().setInitialVelocity()</code></p></div></div></td><td class="tableblock halign-left valign-top"><div><div class="paragraph"><p>Vector3f.ZERO</p></div></div></td><td class="tableblock halign-left valign-top"><div><div class="paragraph"><p>Specify a vector how fast particles move and in which start direction.</p></div></div></td></tr><tr><td class="tableblock halign-left valign-top"><div><div class="paragraph"><p>direction</p></div></div></td><td class="tableblock halign-left valign-top"><div><div class="paragraph"><p><code>getParticleInfluencer().setVelocityVariation()</code><br>
- <code>setFacingVelocity()</code><br>
- <code>setRandomAngle()</code><br>
- <code>setFaceNormal()</code><br>
- <code>setRotateSpeed()</code></p></div></div></td><td class="tableblock halign-left valign-top"><div><div class="paragraph"><p>0.2f<br>
- false<br>
- false<br>
- Vector3f.NAN<br>
- 0.0f</p></div></div></td><td class="tableblock halign-left valign-top"><div><div class="paragraph"><p>Optional accessors that control in which direction particles face while flying.</p></div></div></td></tr><tr><td class="tableblock halign-left valign-top"><div><div class="paragraph"><p>lifetime</p></div></div></td><td class="tableblock halign-left valign-top"><div><div class="paragraph"><p><code>setLowLife()</code><br>
- <code>setHighLife()</code></p></div></div></td><td class="tableblock halign-left valign-top"><div><div class="paragraph"><p>3f<br>
- 7f</p></div></div></td><td class="tableblock halign-left valign-top"><div><div class="paragraph"><p>Minimum and maximum time period before particles fade.</p></div></div></td></tr><tr><td class="tableblock halign-left valign-top"><div><div class="paragraph"><p>emission rate</p></div></div></td><td class="tableblock halign-left valign-top"><div><div class="paragraph"><p><code>setParticlesPerSec()</code></p></div></div></td><td class="tableblock halign-left valign-top"><div><div class="paragraph"><p>20</p></div></div></td><td class="tableblock halign-left valign-top"><div><div class="paragraph"><p>How many new particles are emitted per second.</p></div></div></td></tr><tr><td class="tableblock halign-left valign-top"><div><div class="paragraph"><p>color</p></div></div></td><td class="tableblock halign-left valign-top"><div><div class="paragraph"><p><code>setStartColor()</code><br>
- <code>setEndColor()</code></p></div></div></td><td class="tableblock halign-left valign-top"><div><div class="paragraph"><p>gray</p></div></div></td><td class="tableblock halign-left valign-top"><div><div class="paragraph"><p>Set to the same colors, or to two different colors for a gradient effect.</p></div></div></td></tr><tr><td class="tableblock halign-left valign-top"><div><div class="paragraph"><p>size</p></div></div></td><td class="tableblock halign-left valign-top"><div><div class="paragraph"><p><code>setStartSize()</code><br>
- <code>setEndSize()</code></p></div></div></td><td class="tableblock halign-left valign-top"><div><div class="paragraph"><p>0.2f<br>
- 2f</p></div></div></td><td class="tableblock halign-left valign-top"><div><div class="paragraph"><p>Set to two different values for shrink/grow effect, or to same size for constant effect.</p></div></div></td></tr><tr><td class="tableblock halign-left valign-top"><div><div class="paragraph"><p>gravity</p></div></div></td><td class="tableblock halign-left valign-top"><div><div class="paragraph"><p><code>setGravity()</code></p></div></div></td><td class="tableblock halign-left valign-top"><div><div class="paragraph"><p>0,1,0</p></div></div></td><td class="tableblock halign-left valign-top"><div><div class="paragraph"><p>Whether particles fall down (positive) or fly up (negative). Set to 0f for a zero-g effect where particles keep flying.</p></div></div></td></tr></tbody></table>
- <div class="paragraph"><p>You can find details about <a href="../../jme3/advanced/particle_emitters.html#configure_parameters">effect parameters</a> here.
- Add and modify one parameter at a time, and try different values until you get the effect you want.</p></div>
- <div class="admonitionblock tip"><table><tr><td class="icon"><i class="fa icon-tip" title="Tip"></i></td><td class="content"><div class="paragraph"><p>Use the SceneComposer in the jMonkeyEngine SDK to create effects more easily. Create an empty scene and add an emitter object to it. Change the emitter properties and watch the outcome live. You can save created effects as .j3o file and load them like scenes or models.</p></div></td></tr></table></div></div></div>
- <div class="sect1"><h2 id="exercise">Exercise</h2><div class="sectionbody"><div class="paragraph"><p>Can you “invert” the fire effect into a small waterfall? Here some tips:</p></div>
- <div class="ulist"><ul><li><p>Change the Red and Yellow color to Cyan and Blue</p></li><li><p>Invert the velocity vector (direction) by using a negative number</p></li><li><p>Swap start and end size</p></li><li><p>Activate gravity by setting it to 0,1,0</p></li></ul></div></div></div>
- <div class="sect1"><h2 id="conclusion">Conclusion</h2><div class="sectionbody"><div class="paragraph"><p>You have learned that many different effects can be created by changing the parameters and textures of one general emitter object.</p></div>
- <div class="paragraph"><p>Now you move on to another exciting chapter – the simulation of <a href="../../jme3/beginner/hello_physics.html">physical objects</a>. Let’s shoot some cannon balls at a brick wall!</p></div></div></div></div><div id="footer"><div id="footer-text">Version <br>Last updated 2020-05-21 00:29:23 +00:00</div></div><script type="text/javascript" src="https://cdn.jsdelivr.net/docsearch.js/2/docsearch.min.js"></script><script>docsearch({
- apiKey: 'a736b6d93de805e26ec2f49b55013fbd',
- indexName: 'jmonkeyengine',
- inputSelector: '#doc-search',
- debug: false // Set debug to true if you want to inspect the dropdown
- });</script></body></html>
|