PageRenderTime 63ms CodeModel.GetById 25ms RepoModel.GetById 1ms app.codeStats 0ms

/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/faq.html

https://bitbucket.org/aerivan/jmonkeyengine
HTML | 904 lines | 632 code | 201 blank | 71 comment | 0 complexity | d33eda1e3ceb1cc35e1ff89547c67f79 MD5 | raw file
Possible License(s): BSD-3-Clause, LGPL-2.0, LGPL-2.1, GPL-2.0

Large files files are truncated, but you can click here to view the full file

  1. <h1><a>Frequently Asked Questions</a></h1>
  2. <div>
  3. </div>
  4. <!-- EDIT1 SECTION "Frequently Asked Questions" [1-41] -->
  5. <h2><a>I want to create and configure a jME3 Application</a></h2>
  6. <div>
  7. </div>
  8. <!-- EDIT2 SECTION "I want to create and configure a jME3 Application" [42-103] -->
  9. <h3><a>How do I start writing a preconfigured jME game?</a></h3>
  10. <div>
  11. <p>
  12. Write a Java class that extends <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://code.google.com/p/jmonkeyengine/source/browse/trunk/engine/src/core/com/jme3/app/SimpleApplication.java"><param name="text" value="<html><u>com.jme3.app.SimpleApplication</u></html>"><param name="textColor" value="blue"></object>.
  13. <br/>
  14. <strong>Learn more:</strong> <a href="/com/jme3/gde/docs/jme3/beginner/hello_simpleapplication.html">Hello SimpleApplication</a>, <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://code.google.com/p/jmonkeyengine/source/browse/trunk/engine/src/core/com/jme3/app/SimpleApplication.java"><param name="text" value="<html><u>com.jme3.app.SimpleApplication</u></html>"><param name="textColor" value="blue"></object>.
  15. </p>
  16. </div>
  17. <!-- EDIT3 SECTION "How do I start writing a preconfigured jME game?" [104-551] -->
  18. <h3><a>How do I change the background color?</a></h3>
  19. <div>
  20. <pre>viewPort.setBackgroundColor&#40;ColorRGBA.Blue&#41;;</pre>
  21. </div>
  22. <!-- EDIT4 SECTION "How do I change the background color?" [552-662] -->
  23. <h3><a>Can I customize the SimpleApplication class?</a></h3>
  24. <div>
  25. <p>
  26. Yes! Actually, you MUST customize it! For your own games, you always create a custom base class that extends <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://code.google.com/p/jmonkeyengine/source/browse/trunk/engine/src/core/com/jme3/app/SimpleApplication.java"><param name="text" value="<html><u>com.jme3.app.SimpleApplication</u></html>"><param name="textColor" value="blue"></object> class. From now on it&#039;s no longer a &quot;simple application&quot; ??? it&#039;s now your game. Configure your <a href="/com/jme3/gde/docs/jme3/intermediate/appsettings.html">application settings</a>, implement methods, and customize away!
  27. <br/>
  28. <strong>Learn more:</strong> <a href="/com/jme3/gde/docs/jme3/intermediate/simpleapplication.html">SimpleApplication</a>, <a href="/com/jme3/gde/docs/jme3/intermediate/appsettings.html">AppSettings</a>.
  29. </p>
  30. </div>
  31. <!-- EDIT5 SECTION "Can I customize the SimpleApplication class?" [663-1259] -->
  32. <h3><a>How can I switch between screens or states?</a></h3>
  33. <div>
  34. <p>
  35. You should break app your application logic into components by spreading it out over individual AppStates. AppStates can be attached to and detached from the game. AppStates have access to all objects (rootNode, PhysicsSpace, inputManager, etc) and methods in your main application. So each AppState can bring its own subset of input handlers, <acronym title="Graphical User Interface">GUI</acronym> nodes, spatial nodes, and even its own subset of game mechanics in the update() loop.
  36. <br/>
  37. <strong>Learn more:</strong> <a href="/com/jme3/gde/docs/jme3/advanced/application_states.html">Application States</a>.
  38. </p>
  39. </div>
  40. <!-- EDIT6 SECTION "How can I switch between screens or states?" [1260-1804] -->
  41. <h3><a>How do I pause/unpause a game?</a></h3>
  42. <div>
  43. <p>
  44. You split up your application into several AppStates and implement the setEnabled() methods for each state. Then you create, for example, a GameRunningAppState and a GamePausedAppState. GamePausedAppState&#039;s job is to attach all your AppStates that contain the logic and <acronym title="Graphical User Interface">GUI</acronym> of the pause screen, and to detach all the AppStates that contain logic and <acronym title="Graphical User Interface">GUI</acronym> of the running game. GameRunningAppState does the opposite. By attaching one or the other to the game, you switch between the paused and unpaused states.
  45. <br/>
  46. <strong>Learn more:</strong> <a href="/com/jme3/gde/docs/jme3/advanced/application_states.html">Application States</a>.
  47. </p>
  48. </div>
  49. <!-- EDIT7 SECTION "How do I pause/unpause a game?" [1805-2410] -->
  50. <h3><a>How do I disable logger output to the console?</a></h3>
  51. <div>
  52. <p>
  53. During development, you can switch the severity level of the default logger to no longer print FINE warnings, but only WARNINGs.
  54. </p>
  55. <pre>java.util.logging.Logger.getLogger&#40;&quot;&quot;&#41;.setLevel&#40;Level.WARNING&#41;;</pre>
  56. <p>
  57. For the release, switch the severity level of the default logger to print only SEVERE errors.
  58. </p>
  59. <pre>java.util.logging.Logger.getLogger&#40;&quot;&quot;&#41;.setLevel&#40;Level.SEVERE&#41;;</pre>
  60. <p>
  61. <strong>Learn more:</strong> <a href="/com/jme3/gde/docs/jme3/advanced/logging.html">Logging</a>.
  62. </p>
  63. </div>
  64. <!-- EDIT8 SECTION "How do I disable logger output to the console?" [2411-2897] -->
  65. <h3><a>Why does the executable crash with &quot;Cannot locate resource&quot;?</a></h3>
  66. <div>
  67. <p>
  68. Make sure to only load() models converted to .j3o binary format, not the original Ogre or Wavefront formats. If you load assets from zip files, make sure to ammend the build script to copy them ito the build.
  69. <br/>
  70. <strong>Learn more:</strong> <a href="/com/jme3/gde/docs/jme3/advanced/asset_manager.html">Asset Manager</a>
  71. </p>
  72. </div>
  73. <!-- EDIT9 SECTION "Why does the executable crash with Cannot locate resource?" [2898-3228] -->
  74. <h3><a>What is java.lang.LinkageError: Version mismatch?</a></h3>
  75. <div>
  76. <p>
  77. This rare exception shows a message similar to the following: <code>Exception in thread &quot;LWJGL Renderer Thread&quot; java.lang.LinkageError: Version mismatch: jar version is (number), native library version is (another number)</code>. jME3 needs native libraries (.dll, .jnilib, lib*.so files) to run LWJGL and jBullet. The correct versions of these libraries are included when you install the <acronym title="Software Development Kit">SDK</acronym> or download the binaries. However there are circumstances where jME3 cannot determine which copy of the native library it should use: <br/>
  78. If you install another application that needs a different version of a native library, and this app globally installs its version over jME3&#039;s; or if an old copy of a native library is in your project directory, your home directory, or Java library path, or in the classpath; or if you permanently linked an old copy in your IDE&#039;s settings; then Java assumes you prefer these native libraries over the bundled ones, and your jME3 application ends up running with the wrong version. <br/>
  79. To fix this, search for .dll (Windows), .jnilib (Mac), and .so (Linux) files for jBullet and LWJGL on your harddrive and in your path and IDE settings, and verify they don&#039;t interfere. (If you have other jME versions installed and linked somehow, the outdated natives may also be in a lwjgl.jar or jbullet.jar file!)
  80. </p>
  81. </div>
  82. <!-- EDIT10 SECTION "What is java.lang.LinkageError: Version mismatch?" [3229-4612] -->
  83. <h2><a>I want to load my scene</a></h2>
  84. <div>
  85. </div>
  86. <!-- EDIT11 SECTION "I want to load my scene" [4613-4648] -->
  87. <h3><a>How do I make objects appear / disappear in the 3D scene?</a></h3>
  88. <div>
  89. <p>
  90. To make a spatial appear in the scene, you attach it to the rootNode (or to a node that is attached to the rootnode). To remove a spatial, you detach it from its parent node.
  91. </p>
  92. <pre>rootNode.attachChild&#40;spatial&#41;; // appear in scene</pre>
  93. <pre>rootNode.detachChild&#40;spatial&#41;; // remove from scene</pre>
  94. <p>
  95. <strong>Learn more:</strong> <a href="/com/jme3/gde/docs/jme3/the_scene_graph.html">The Scene Graph</a>, <a href="/com/jme3/gde/docs/jme3/beginner/hello_node.html">Hello Node</a>, <a href="/com/jme3/gde/docs/jme3/beginner/hello_asset.html">Hello Asset</a>, <a href="/com/jme3/gde/docs/jme3/advanced/spatial.html">Spatial</a>, <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://code.google.com/p/jmonkeyengine/source/browse/trunk/engine/src/core/com/jme3/scene/Node.java"><param name="text" value="<html><u>com.jme3.scene.Node</u></html>"><param name="textColor" value="blue"></object> and <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://code.google.com/p/jmonkeyengine/source/browse/trunk/engine/src/core/com/jme3/scene/Geometry.java"><param name="text" value="<html><u>com.jme3.scene.Geometry</u></html>"><param name="textColor" value="blue"></object>.
  96. </p>
  97. </div>
  98. <!-- EDIT12 SECTION "How do I make objects appear / disappear in the 3D scene?" [4649-5425] -->
  99. <h3><a>Why do I get AssetNotFoundException when loading X ?</a></h3>
  100. <div>
  101. <p>
  102. First check whether the file path of the asset is correct. By default it is relative to your project&#039;s assets directory:
  103. </p>
  104. <pre>// To load .../jMonkeyProjects/MyGame/assets/Models/Ninja/Ninja.j3o
  105. Spatial ninja = assetManager.loadModel&#40;&quot;Models/Ninja/Ninja.j3o&quot;&#41;;</pre>
  106. <p>
  107. If you are not using the default <code>assets</code> directory, verify that you have registered a locator to the AssetManager. <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://jmonkeyengine.org/javadoc/com/jme3/asset/plugins/package-summary.html"><param name="text" value="<html><u>Different Locator types</u></html>"><param name="textColor" value="blue"></object> are available.
  108. </p>
  109. <pre>this.assetManager.registerLocator&#40;&quot;assets/&quot;, FileLocator.class&#41;; // default
  110. this.assetManager.registerLocator&#40;&quot;c:/jme3User/JMEisSoCool/myAwesomeFolder/&quot;, FileLocator.class&#41;;
  111. this.assetManager.registerLocator&#40;&quot;town.zip&quot;, ZipLocator.class&#41;;</pre>
  112. <p>
  113. <strong>Learn more:</strong> <a href="/com/jme3/gde/docs/jme3/advanced/asset_manager.html">Asset Manager</a>
  114. </p>
  115. </div>
  116. <!-- EDIT13 SECTION "Why do I get AssetNotFoundException when loading X ?" [5426-6308] -->
  117. <h3><a>How do I Create 3-D models, textures, sounds?</a></h3>
  118. <div>
  119. <p>
  120. Follow our best practices for the <a href="/com/jme3/gde/docs/jme3/intermediate/multi-media_asset_pipeline.html">multi-media asset pipeline</a>. <br/>
  121. You create 3-D models in a 3-D mesh editor, for example Blender, and export it in Ogre Mesh <acronym title="Extensible Markup Language">XML</acronym> (animated objects, scenes) or Wavefront OBJ format (static objects, scenes).
  122. You create textures in a graphic editor, for example Gimp, and export them as <acronym title="Portable Network Graphics">PNG</acronym> or <acronym title="Joint Photographics Experts Group">JPG</acronym>.
  123. You create sounds in an audio editor, for example, Audacity, and export them as WAVE or OGG.
  124. <br/>
  125. <strong>Learn more:</strong> <a href="/com/jme3/gde/docs/jme3/advanced/3d_models.html">3D Models</a>, <a href="/com/jme3/gde/docs/jme3/intermediate/multi-media_asset_pipeline.html">Multi-Media Asset Pipeline</a>, <a href="/com/jme3/gde/docs/sdk/blender.html">JME3&#039;s blend-to-j3o importer</a>; <br/>
  126. <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://blender.org"><param name="text" value="<html><u>Download Blender</u></html>"><param name="textColor" value="blue"></object>, <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://en.wikibooks.org/wiki/Blender_3D:_Noob_to_Pro"><param name="text" value="<html><u>Blender intro tutorial</u></html>"><param name="textColor" value="blue"></object>, <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://www.ogre3d.org/wiki/index.php/Blender_Exporter"><param name="text" value="<html><u>Blender-to-Ogre plugin</u></html>"><param name="textColor" value="blue"></object>, <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://en.wikipedia.org/wiki/Comparison_of_3D_computer_graphics_software#Features"><param name="text" value="<html><u>Comparison of 3D graphic software features (Wikipedia)</u></html>"><param name="textColor" value="blue"></object>.
  127. </p>
  128. </div>
  129. <!-- EDIT14 SECTION "How do I Create 3-D models, textures, sounds?" [6309-7306] -->
  130. <h3><a>How do I load a 3-D model into the scene?</a></h3>
  131. <div>
  132. <p>
  133. Use the jMonkeyEngine <acronym title="Software Development Kit">SDK</acronym> to convert models from Ogre <acronym title="Extensible Markup Language">XML</acronym> or Wavefront OBJ formats to .j3o binary format. Load the .j3o file using the AssetManager.
  134. </p>
  135. <pre>// To load .../jMonkeyProjects/MyGame/assets/Models/Ninja/Ninja.j3o
  136. Spatial ninja = assetManager.loadModel&#40;&quot;Models/Ninja/Ninja.j3o&quot;&#41;;</pre>
  137. <p>
  138. <strong>Learn more:</strong> <a href="/com/jme3/gde/docs/jme3/beginner/hello_asset.html">Hello Asset</a>, <a href="/com/jme3/gde/docs/jme3/advanced/asset_manager.html">Asset Manager</a>, <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://code.google.com/p/jmonkeyengine/source/browse/trunk/engine/src/core/com/jme3/asset/AssetManager.java"><param name="text" value="<html><u>come.jme3.assets.AssetManager</u></html>"><param name="textColor" value="blue"></object>, <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://code.google.com/p/jmonkeyengine/source/browse/trunk/engine/src/ogre/com/jme3/scene/plugins/ogre/"><param name="text" value="<html><u>com.jme3.scene.plugins.ogre], [[http://code.google.com/p/jmonkeyengine/source/browse/trunk/engine/src/core/com/jme3/scene/Geometry.java|com.jme3.scene.Geometry</u></html>"><param name="textColor" value="blue"></object>, <a href="/com/jme3/gde/docs/sdk/model_loader_and_viewer.html">jMonkeyEngine SDK j3o converter</a>,
  139. <br/>
  140. <strong>Code sample:</strong> <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://code.google.com/p/jmonkeyengine/source/browse/trunk/engine/src/test/jme3test/model/TestOgreLoading.java"><param name="text" value="<html><u>TestOgreLoading.java</u></html>"><param name="textColor" value="blue"></object>, <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://code.google.com/p/jmonkeyengine/source/browse/trunk/engine/src/test/jme3test/export/TestOgreConvert.java"><param name="text" value="<html><u>TestOgreConvert.java</u></html>"><param name="textColor" value="blue"></object>.
  141. </p>
  142. </div>
  143. <!-- EDIT15 SECTION "How do I load a 3-D model into the scene?" [7307-8512] -->
  144. <h3><a>How do initialize the scene?</a></h3>
  145. <div>
  146. <p>
  147. Use the simpleInitApp() method in SimpleApplication (or initApp() in Application).
  148. <br/>
  149. <strong>Learn more:</strong> <a href="/com/jme3/gde/docs/jme3/beginner/hello_simpleapplication.html">Hello SimpleApplication</a>, <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://code.google.com/p/jmonkeyengine/source/browse/trunk/engine/src/core/com/jme3/app/SimpleApplication.java"><param name="text" value="<html><u>com.jme3.app.SimpleApplication</u></html>"><param name="textColor" value="blue"></object>.
  150. </p>
  151. </div>
  152. <!-- EDIT16 SECTION "How do initialize the scene?" [8513-8845] -->
  153. <h2><a>I want to transform objects in the scene</a></h2>
  154. <div>
  155. </div>
  156. <!-- EDIT17 SECTION "I want to transform objects in the scene" [8846-8898] -->
  157. <h3><a>How do I move or turn or resize a spatial?</a></h3>
  158. <div>
  159. <p>
  160. To move or turn or resize a spatial you use transformations. You can concatenate transformations (e.g. perform rotations around several axes in one step using a Quaternion with <code>slerp()</code> or a com.jme3.math.Transform with interpolateTransforms().
  161. </p>
  162. <pre>spatial.setLocalTranslation&#40;1,-3,2.5f&#41;; spatial.rotate&#40;0,3.14f,0&#41;; spatial.scale&#40;2,2,2&#41;;</pre>
  163. <p>
  164. <strong>Learn more:</strong> <a href="/com/jme3/gde/docs/jme3/beginner/hello_node.html">Hello Node</a>, <a href="/com/jme3/gde/docs/jme3/advanced/spatial.html">Spatial</a>, <a href="/com/jme3/gde/docs/jme2/rotate.html">rotate</a>, <a href="/com/jme3/gde/docs/jme2/rotate_about_a_point.html">rotate_about_a_point</a>, <a href="/com/jme3/gde/docs/jme2/quaternion.html">quaternion</a>, <a href="/com/jme3/gde/docs/jme3/math_for_dummies.html">math_for_dummies</a>.
  165. </p>
  166. </div>
  167. <!-- EDIT18 SECTION "How do I move or turn or resize a spatial?" [8899-9480] -->
  168. <h3><a>How do I make a spatial move by itself?</a></h3>
  169. <div>
  170. <p>
  171. Change the geometry&#039;s translation (position) live in the update loop using setLocalTranslation() for non-physical and applyForce() or setWalkDirection() for physical objects. You can also define and remote-control a spatial&#039;s motion using <a href="/com/jme3/gde/docs/jme3/advanced/cinematics.html">Cinematics</a>, e.g. to record cutscenes, or to implement mobile platforms, elevators, airships, etc.
  172. <br/>
  173. <strong>Learn more:</strong> <a href="/com/jme3/gde/docs/jme3/beginner/hello_main_event_loop.html">Hello Loop</a>, <a href="/com/jme3/gde/docs/jme3/advanced/update_loop.html">Update Loop</a>, <a href="/com/jme3/gde/docs/jme3/advanced/custom_controls.html">Custom Controls</a>, <a href="/com/jme3/gde/docs/jme3/advanced/cinematics.html">Cinematics</a>
  174. <br/>
  175. <strong>Code sample:</strong> <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://code.google.com/p/jmonkeyengine/source/browse/trunk/engine/src/test/jme3test/material/TestBumpModel.java"><param name="text" value="<html><u>TestBumpModel.java</u></html>"><param name="textColor" value="blue"></object>, <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://code.google.com/p/jmonkeyengine/source/browse/trunk/engine/src/test/jme3test/model/TestOgreLoading.java"><param name="text" value="<html><u>TestOgreLoading.java</u></html>"><param name="textColor" value="blue"></object>
  176. </p>
  177. </div>
  178. <!-- EDIT19 SECTION "How do I make a spatial move by itself?" [9481-10344] -->
  179. <h3><a>How do I access a named sub-mesh in Model?</a></h3>
  180. <div>
  181. <pre>Geometry result = spatial.getName&#40;&#41;.startsWith&#40;name&#41;;</pre>
  182. <p>
  183. <strong>Learn more:</strong> <a href="/com/jme3/gde/docs/jme3/advanced/spatial.html">Spatial</a>
  184. </p>
  185. </div>
  186. <!-- EDIT20 SECTION "How do I access a named sub-mesh in Model?" [10345-10512] -->
  187. <h3><a>How do I make procedural or custom shapes?</a></h3>
  188. <div>
  189. <p>
  190. You can programmatically create com.jme3.scene.Mesh&#039;es.
  191. <br/>
  192. <strong>Learn more:</strong> <a href="/com/jme3/gde/docs/jme3/advanced/custom_meshes.html">Custom Meshes</a>
  193. </p>
  194. </div>
  195. <!-- EDIT21 SECTION "How do I make procedural or custom shapes?" [10513-10673] -->
  196. <h2><a>I want to change the surface of objects in the scene</a></h2>
  197. <div>
  198. </div>
  199. <!-- EDIT22 SECTION "I want to change the surface of objects in the scene" [10674-10738] -->
  200. <h3><a>Why is my UV wrapping / texture appearance all wrong?</a></h3>
  201. <div>
  202. <p>
  203. The most likely reason is the flipping of textures. You may be using the following default method:
  204. </p>
  205. <pre> material.setTexture&#40;&quot;ColorMap&quot;, assetManager.loadTexture&#40;&quot;myTexture.jpg&quot;&#41;&#41;;</pre>
  206. <p>
  207. You can set the boolean value in the constructor of TextureKey to flipped or not flipped. Toggle the boolean to see if it fixes your UV wrapping/texture problem:
  208. </p>
  209. <pre> material.setTexture&#40;&quot;ColorMap&quot;, this.assetManager.loadTexture&#40;new TextureKey&#40;&quot;myTexture.jpg&quot;, false&#41;&#41;&#41;;</pre>
  210. </div>
  211. <!-- EDIT23 SECTION "Why is my UV wrapping / texture appearance all wrong?" [10739-11288] -->
  212. <h3><a>How do I scale, mirror, or wrap a texture?</a></h3>
  213. <div>
  214. <p>
  215. You cannot scale a texture, but you scale the texture coordinates of the mesh the texture is applied to:
  216. </p>
  217. <pre>mesh.scaleTextureCoordinates&#40;new Vector2f&#40;2,2&#41;&#41;;</pre>
  218. <p>
  219. You can choose among various <code>com.jme3.texture.Texture.WrapMode</code>s for individual texture maps of a material: BorderClamp, EdgeClamp, Clamp; MirrorBorderClamp, MirrorEdgeClamp, MirrorClamp; Repeat, MirroredRepeat.
  220. </p>
  221. <pre>material.getTextureParam&#40;&quot;DiffuseMap&quot;&#41;.getTextureValue&#40;&#41;.setWrap&#40;WrapMode.Repeat&#41;;</pre>
  222. </div>
  223. <!-- EDIT24 SECTION "How do I scale, mirror, or wrap a texture?" [11289-11830] -->
  224. <h3><a>How do I change color or shininess of an material?</a></h3>
  225. <div>
  226. <p>
  227. Use the AssetManager to load Materials, and change material settings.
  228. <br/>
  229. <strong>Learn more:</strong> <a href="/com/jme3/gde/docs/jme3/beginner/hello_material.html">Hello Material</a>, <a href="/com/jme3/gde/docs/jme3/intermediate/how_to_use_materials.html">How To Use Materials</a>, <a href="/com/jme3/gde/docs/jme3/advanced/materials_overview.html">Materials Overview</a>, <a href="/com/jme3/gde/docs/jme3/advanced/asset_manager.html">Asset Manager</a>.
  230. <br/>
  231. <strong>Code sample:</strong> <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://code.google.com/p/jmonkeyengine/source/browse/trunk/engine/src/test/jme3test/light/TestNormalMapping.java"><param name="text" value="<html><u>TestNormalMapping.java</u></html>"><param name="textColor" value="blue"></object>, <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://code.google.com/p/jmonkeyengine/source/browse/trunk/engine/src/test/jme3test/model/TestSphere.java"><param name="text" value="<html><u>TestSphere.java</u></html>"><param name="textColor" value="blue"></object>.
  232. </p>
  233. </div>
  234. <!-- EDIT25 SECTION "How do I change color or shininess of an material?" [11831-12418] -->
  235. <h3><a>How do I make a surface wood, stone, metal, etc?</a></h3>
  236. <div>
  237. <p>
  238. Create Textures as image files. Use the AssetManager to load a Material and use texture mapping for improved looks.
  239. <br/>
  240. <strong>Learn more:</strong> <a href="/com/jme3/gde/docs/jme3/beginner/hello_material.html">Hello Material</a>, <a href="/com/jme3/gde/docs/jme3/intermediate/how_to_use_materials.html">How To Use Materials</a>, <a href="/com/jme3/gde/docs/jme3/advanced/materials_overview.html">Materials Overview</a>, <a href="/com/jme3/gde/docs/jme3/advanced/asset_manager.html">Asset Manager</a>, <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://code.google.com/p/jmonkeyengine/source/browse/trunk/engine/src/core/com/jme3/asset/AssetManager.java"><param name="text" value="<html><u>come.jme3.assets.AssetManager</u></html>"><param name="textColor" value="blue"></object>, <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://wiki.blender.org/index.php/Doc:Manual/Textures/Maps/Bump_and_Normal_Maps"><param name="text" value="<html><u>Blender: Creating Bump Maps and Normal Maps</u></html>"><param name="textColor" value="blue"></object>
  241. <br/>
  242. <strong>Code sample:</strong> <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://code.google.com/p/jmonkeyengine/source/browse/trunk/engine/src/test/jme3test/material/TestSimpleBumps.java"><param name="text" value="<html><u>TestSimpleBumps.java</u></html>"><param name="textColor" value="blue"></object>
  243. </p>
  244. </div>
  245. <!-- EDIT26 SECTION "How do I make a surface wood, stone, metal, etc?" [12419-13192] -->
  246. <h3><a>Why are materials too bright, too dark, or flickering?</a></h3>
  247. <div>
  248. <p>
  249. If you use a lit material (based on Lighting.j3md) then you must attach a light source to the rootNode, otherwise you see nothing. If you use lit material colors, make sure you have specified an Ambient color (can be the same as the Diffuse color) if you use an AmbientLight. If you see objects, but they are gray or too dark, set the light color to white, or make it brighter (you can multiply the color value with a scalar), or add a global white light source (AmbientLight). Similarly, if everything is too white, tune down the lights. If materials flicker under a directional light, change the light direction vector. Change the background color (which is independent of light sources) to get a better contrast while debugging a light problem.
  250. </p>
  251. </div>
  252. <!-- EDIT27 SECTION "Why are materials too bright, too dark, or flickering?" [13193-14006] -->
  253. <h3><a>How do I make geometries cast a shadow?</a></h3>
  254. <div>
  255. <p>
  256. Use com.jme3.shadow.BasicShadowRenderer together with com.jme3.light.DirectionalLight, and setShadowMode().
  257. <br/>
  258. <strong>Learn more:</strong> <a href="/com/jme3/gde/docs/jme3/advanced/light_and_shadow.html">Light and Shadow</a>
  259. <br/>
  260. <strong>Code sample:</strong> <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://code.google.com/p/jmonkeyengine/source/browse/trunk/engine/src/test/jme3test/jme3test/fx/TestEverything.java"><param name="text" value="<html><u>TestEverything.java</u></html>"><param name="textColor" value="blue"></object>, <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://code.google.com/p/jmonkeyengine/source/browse/trunk/engine/src/test/jme3test/jme3test/light/TestShadow.java"><param name="text" value="<html><u>TestShadow.java</u></html>"><param name="textColor" value="blue"></object>
  261. </p>
  262. </div>
  263. <!-- EDIT28 SECTION "How do I make geometries cast a shadow?" [14007-14515] -->
  264. <h3><a>How do I make materials transparent?</a></h3>
  265. <div>
  266. <p>
  267. Assign a texture with an alpha channel to a Material and set the Material&#039;s blend mode to alpha. Use this to create transparent or translucent materials such as glass, window panes, water, tree leaves, etc.
  268. </p>
  269. <pre>material.getAdditionalRenderState&#40;&#41;.setBlendMode&#40;BlendMode.Alpha&#41;;</pre>
  270. <p>
  271. <strong>Learn more:</strong> <a href="/com/jme3/gde/docs/jme3/beginner/hello_material.html">Hello Material</a>, <a href="/com/jme3/gde/docs/jme3/intermediate/how_to_use_materials.html">How To Use Materials</a>,
  272. </p>
  273. </div>
  274. <!-- EDIT29 SECTION "How do I make materials transparent?" [14516-14952] -->
  275. <h3><a>How do I force or disable culling?</a></h3>
  276. <div>
  277. <p>
  278. While debugging custom meshes, you can switch the <code>com.jme3.material.RenderState.FaceCullMode</code> off to see the inside and outside of the mesh.
  279. </p>
  280. <pre>someMaterial.getAdditionalRenderState&#40;&#41;.setFaceCullMode&#40;FaceCullMode.Off&#41;;</pre>
  281. <p>
  282. You can also deactivate the <code>com.jme3.scene.Spatial.CullHint</code> of a whole spatial to force jme to calculate it even if it is behind the camera and outside of view.
  283. </p>
  284. <pre>someNode.setCullHint&#40;CullHint.Never&#41;;</pre>
  285. <p>
  286. <strong>Learn more:</strong> <a href="/com/jme3/gde/docs/jme3/advanced/spatial.html">Spatial</a>
  287. </p>
  288. </div>
  289. <!-- EDIT30 SECTION "How do I force or disable culling?" [14953-15501] -->
  290. <h3><a>Can I draw only an outline of the scene?</a></h3>
  291. <div>
  292. <p>
  293. Add a renders state to the material&#039;s and activate <code>Wireframe</code>.
  294. </p>
  295. <pre>material.getAdditionalRenderState&#40;&#41;.setWireframe&#40;true&#41;;</pre>
  296. <p>
  297. <strong>Learn more:</strong> <a href="/com/jme3/gde/docs/jme3/advanced/debugging.html">Debugging</a>.
  298. </p>
  299. </div>
  300. <!-- EDIT31 SECTION "Can I draw only an outline of the scene?" [15502-15738] -->
  301. <h2><a>I want to control the camera</a></h2>
  302. <div>
  303. </div>
  304. <!-- EDIT32 SECTION "I want to control the camera" [15739-15779] -->
  305. <h3><a>How do I switch between third-person and first-person view ?</a></h3>
  306. <div>
  307. <p>
  308. The default camera is the <code>cam</code> object. <strong>Learn more:</strong> <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://code.google.com/p/jmonkeyengine/source/browse/trunk/engine/src/core/com/jme3/renderer/Camera.java"><param name="text" value="<html><u>com.jme3.renderer.Camera</u></html>"><param name="textColor" value="blue"></object>
  309. </p>
  310. <ul>
  311. <li><div> You can activate the FlyBy Cam as a first-person camera. <br/>
  312. <strong>Learn more:</strong> <a href="/com/jme3/gde/docs/jme3/beginner/hello_collision.html">Hello Collision</a>. <br/>
  313. <strong>Code sample:</strong> <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://code.google.com/p/jmonkeyengine/source/browse/trunk/engine/src/core/com/jme3/input/FlyByCam.java"><param name="text" value="<html><u>com.jme3.input.FlyByCamera</u></html>"><param name="textColor" value="blue"></object> <pre>flyCam.setEnabled&#40;true&#41;;</pre>
  314. </div>
  315. </li>
  316. <li><div> You can also create a third-person chase cam. <br/>
  317. <strong>Learn more:</strong> <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://code.google.com/p/jmonkeyengine/source/browse/trunk/engine/src/core/com/jme3/input/ChaseCamera.java"><param name="text" value="<html><u>com.jme3.input.ChaseCamera</u></html>"><param name="textColor" value="blue"></object> <br/>
  318. <strong>Code sample:</strong> <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://code.google.com/p/jmonkeyengine/source/browse/trunk/engine/src/test/jme3test/input/TestChaseCamera.java"><param name="text" value="<html><u>jme3test/input/TestChaseCamera.java</u></html>"><param name="textColor" value="blue"></object>. <pre>flyCam.setEnabled&#40;false&#41;;
  319. chaseCam = new ChaseCamera&#40;cam, spatial, inputManager&#41;;</pre>
  320. </div>
  321. </li>
  322. </ul>
  323. </div>
  324. <!-- EDIT33 SECTION "How do I switch between third-person and first-person view ?" [15780-16836] -->
  325. <h3><a>How do I increase camera speed?</a></h3>
  326. <div>
  327. <pre>flyCam.setMoveSpeed&#40;50f&#41;;</pre>
  328. </div>
  329. <!-- EDIT34 SECTION "How do I increase camera speed?" [16837-16923] -->
  330. <h2><a>Actions, Interactions, Physics</a></h2>
  331. <div>
  332. </div>
  333. <!-- EDIT35 SECTION "Actions, Interactions, Physics" [16924-16966] -->
  334. <h3><a>How do I implement game logic / game mechanics?</a></h3>
  335. <div>
  336. <p>
  337. Use Controls to define the behaviour of types of Spatials. Use Application States to implement global behaviour, to group subsets of input handlers or <acronym title="Graphical User Interface">GUI</acronym> screens, etc. Use the <code>simpleUpdate()</code> and <code>update()</code> loops for tests and interactions. Use Cinematics to remote-control objects in scenes.
  338. <br/>
  339. <strong>Learn more:</strong> <a href="/com/jme3/gde/docs/jme3/beginner/hello_main_event_loop.html">Hello Loop</a>, <a href="/com/jme3/gde/docs/jme3/advanced/update_loop.html">Update Loop</a>, <a href="/com/jme3/gde/docs/jme3/advanced/custom_controls.html">Custom Controls</a>, <a href="/com/jme3/gde/docs/jme3/advanced/application_states.html">Application States</a>, <a href="/com/jme3/gde/docs/jme3/advanced/cinematics.html">Cinematics</a>
  340. </p>
  341. </div>
  342. <!-- EDIT36 SECTION "How do I implement game logic / game mechanics?" [16967-17528] -->
  343. <h3><a>How do I let players interact via keyboard?</a></h3>
  344. <div>
  345. <p>
  346. Use com.jme3.input.KeyInput and a Input Listener.
  347. <br/>
  348. <strong>Learn more:</strong> <a href="/com/jme3/gde/docs/jme3/beginner/hello_input_system.html">Hello Input</a>, <a href="/com/jme3/gde/docs/jme3/advanced/input_handling.html">Input Handling</a>
  349. </p>
  350. </div>
  351. <!-- EDIT37 SECTION "How do I let players interact via keyboard?" [17529-17736] -->
  352. <h3><a>How do I let players interact by clicking?</a></h3>
  353. <div>
  354. <p>
  355. Players typically click the mouse to pick up objects, to open doors, to shoot a weapon, etc. Use an Input Listener to respond to mouse clicks, then cast a ray from the player; if it intersects with the bounding volume of a spatial, this is the selected target. The links below contain code samples for both &quot;fixed crosshair&quot; picking and &quot;free mouse pointer&quot; picking.
  356. <br/>
  357. <strong>Learn more:</strong> <a href="/com/jme3/gde/docs/jme3/beginner/hello_picking.html">Hello Picking</a>, <a href="/com/jme3/gde/docs/jme3/advanced/mouse_picking.html">Mouse Picking</a>, <a href="/com/jme3/gde/docs/jme3/advanced/collision_and_intersection.html">Collision and Intersection</a>, <a href="/com/jme3/gde/docs/jme3/advanced/input_handling.html">Input Handling</a>, com.jme3.bounding.*, com.jme3.math.Ray, com.jme3.collision.CollisionResults.
  358. <br/>
  359. <strong>Code sample:</strong> <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://code.google.com/p/jmonkeyengine/source/browse/trunk/engine/src/test/jme3test/bounding/TestRayCollision.java"><param name="text" value="<html><u>TestRayCollision.java</u></html>"><param name="textColor" value="blue"></object>
  360. </p>
  361. </div>
  362. <!-- EDIT38 SECTION "How do I let players interact by clicking?" [17737-18561] -->
  363. <h3><a>How do I animate characters?</a></h3>
  364. <div>
  365. <p>
  366. Create an animated OgreMesh model with bones in a 3-D mesh editor (e.g. Blender).
  367. <br/>
  368. <strong>Learn more:</strong> com.jme3.animation.*, <a href="/com/jme3/gde/docs/jme3/beginner/hello_animation.html">Hello Animation</a>, <a href="/com/jme3/gde/docs/jme3/advanced/animation.html">Animation</a>, <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://wiki.blender.org/index.php/Doc:Tutorials/Animation/BSoD/Character_Animation"><param name="text" value="<html><u>Blender animation tutorial</u></html>"><param name="textColor" value="blue"></object>
  369. <br/>
  370. <strong>Code sample:</strong> <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://code.google.com/p/jmonkeyengine/source/browse/trunk/engine/src/test/jme3test/model/anim/"><param name="text" value="<html><u>animation</u></html>"><param name="textColor" value="blue"></object>
  371. </p>
  372. </div>
  373. <!-- EDIT39 SECTION "How do I animate characters?" [18562-19033] -->
  374. <h3><a>How do I keep players from falling through walls and floors?</a></h3>
  375. <div>
  376. <p>
  377. Use collision detection. The most common solution is to use jme&#039;s physics integration, jBullet.
  378. <br/>
  379. <strong>Learn more:</strong> <a href="/com/jme3/gde/docs/jme3/beginner/hello_collision.html">Hello Collision</a>, <a href="/com/jme3/gde/docs/jme3/advanced/physics.html">Physics</a>, com.jme3.bullet.*, CapsuleCollisionShape versus CompoundCollisionShape, CharacterControl versus RigidBodyControl.
  380. </p>
  381. </div>
  382. <!-- EDIT40 SECTION "How do I keep players from falling through walls and floors?" [19034-19396] -->
  383. <h3><a>How do I make balls/wheels/etc bounce and roll?</a></h3>
  384. <div>
  385. <p>
  386. Add physics controls to Spatials and give them spherical or cylindrical bounding volumes.
  387. <br/>
  388. <strong>Learn more:</strong> <a href="/com/jme3/gde/docs/jme3/beginner/hello_physics.html">Hello Physics</a>, <a href="/com/jme3/gde/docs/jme3/advanced/physics.html">Physics</a>, com.jme3.bounding.*, com.jme3.bullet.collisions, com.jme3.bullet.controls.RigidBodyControl,
  389. <br/>
  390. <strong>Code sample:</strong> <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://code.google.com/p/jmonkeyengine/source/browse/trunk/engine/src/test/jme3test/bullet/TestSimplePhysics.java"><param name="text" value="<html><u>TestSimplePhysics.java</u></html>"><param name="textColor" value="blue"></object>, <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://code.google.com/p/jmonkeyengine/source/browse/trunk/engine/src/test/jme3test/bullet"><param name="text" value="<html><u>more physics samples</u></html>"><param name="textColor" value="blue"></object>
  391. </p>
  392. </div>
  393. <!-- EDIT41 SECTION "How do I make balls/wheels/etc bounce and roll?" [19397-19994] -->
  394. <h3><a>How do I debug weird Physics behaviour?</a></h3>
  395. <div>
  396. <p>
  397. Maybe your collision shapes overlap ??? or they are not where you think they are. Make the collision shapes visible by adding the following line after the bulletAppState initialization:
  398. </p>
  399. <pre>bulletAppState.getPhysicsSpace&#40;&#41;.enableDebug&#40;assetManager&#41;;</pre>
  400. </div>
  401. <!-- EDIT42 SECTION "How do I debug weird Physics behaviour?" [19995-20308] -->
  402. <h3><a>How do I make a walking character?</a></h3>
  403. <div>
  404. <p>
  405. You can use jBullet&#039;s CharacterControl that locks a physical object upright, so it does not tip over when moving/walking (as tall physical objects are wont to do).
  406. <br/>
  407. <strong>Learn more:</strong> CharacterControl
  408. <br/>
  409. Code samples: <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://code.google.com/p/jmonkeyengine/source/browse/trunk/engine/src/test/jme3test/bullet/TestQ3.java"><param name="text" value="<html><u>TestQ3.java</u></html>"><param name="textColor" value="blue"></object> (first-person), <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://code.google.com/p/jmonkeyengine/source/browse/trunk/engine/src/test/jme3test/bullet/TestPhysicsCharacter.java"><param name="text" value="<html><u>TestPhysicsCharacter.java</u></html>"><param name="textColor" value="blue"></object> (third-person)
  410. </p>
  411. </div>
  412. <!-- EDIT43 SECTION "How do I make a walking character?" [20309-20867] -->
  413. <h3><a>How do I steer vehicles?</a></h3>
  414. <div>
  415. <p>
  416. Use a VehicleControl that supports suspension behavior.
  417. <br/>
  418. <strong>Learn more:</strong> <a href="/com/jme3/gde/docs/jme3/advanced/vehicles.html">Vehicles</a>, com.jme3.bullet.*, VehicleControl
  419. <br/>
  420. Code samples: <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://code.google.com/p/jmonkeyengine/source/browse/trunk/engine/src/test/jme3test/bullet/TestFancyCar.java"><param name="text" value="<html><u>TestFancyCar.java</u></html>"><param name="textColor" value="blue"></object>, (Press HUJK keys to steer, spacebar to jump.)
  421. </p>
  422. </div>
  423. <!-- EDIT44 SECTION "How do I steer vehicles?" [20868-21235] -->
  424. <h3><a>Can objects swing like a pendulums, chains, ropebridges?</a></h3>
  425. <div>
  426. <p>
  427. Use a PhysicsControl&#039;s hinges and joints.
  428. <br/>
  429. <strong>Learn more:</strong> <a href="/com/jme3/gde/docs/jme3/advanced/hinges_and_joints.html">Hinges and Joints</a>, com.jme3.bullet.joints.PhysicsHingeJoint,
  430. <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://code.google.com/p/jmonkeyengine/source/browse/trunk/engine/src/test/jme3test/bullet/TestPhysicsHingeJoint.java"><param name="text" value="<html><u>TestPhysicsHingeJoint.java</u></html>"><param name="textColor" value="blue"></object> (Press HK keys to turn, spacebar to swing.)
  431. </p>
  432. </div>
  433. <!-- EDIT45 SECTION "Can objects swing like a pendulums, chains, ropebridges?" [21236-21636] -->
  434. <h2><a>Default GUI Display</a></h2>
  435. <div>
  436. </div>
  437. <!-- EDIT46 SECTION "Default GUI Display" [21637-21668] -->
  438. <h3><a>What are these FPS/Objects/Vertices/Triangles statistics?</a></h3>
  439. <div>
  440. <p>
  441. At the bottom left of every default SimpleGame, you see the <a href="/com/jme3/gde/docs/jme3/advanced/statsview.html">StatsView</a> and the FPS (frames per seconds) view. These views provide you with extra information during the development phase. For example, if you notice the object count is increasing and the FPS is decreasing, then you know that your code attaches too many objects and does not detach enough of them again (maybe a loop gone wild?).
  442. <br/>
  443. <strong>Learn more:</strong> <a href="/com/jme3/gde/docs/jme3/advanced/statsview.html">StatsView</a>
  444. </p>
  445. </div>
  446. <!-- EDIT47 SECTION "What are these FPS/Objects/Vertices/Triangles statistics?" [21669-22196] -->
  447. <h3><a>How do I get rid of the FPS/Objects statistics?</a></h3>
  448. <div>
  449. <p>
  450. In the application&#039;s simpleInitApp() method, call:
  451. </p>
  452. <pre>setDisplayFps(false); // to hide the FPS
  453. setDisplayStatView(false); // to hide the statistics </pre>
  454. <p>
  455. <br/>
  456. <strong>Learn more:</strong> <a href="/com/jme3/gde/docs/jme3/advanced/statsview.html">StatsView</a>
  457. </p>
  458. </div>
  459. <!-- EDIT48 SECTION "How do I get rid of the FPS/Objects statistics?" [22197-22461] -->
  460. <h3><a>How do I display score, health, mini-maps, status icons?</a></h3>
  461. <div>
  462. <p>
  463. Attach text and pictures to the orthogonal <code>guiNode</code> to create a heads-up display (<object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://en.wikipedia.org/wiki/HUD_%28video_gaming%29"><param name="text" value="<html><u>HUD</u></html>"><param name="textColor" value="blue"></object>).
  464. <br/>
  465. <strong>Learn more:</strong> <a href="/com/jme3/gde/docs/jme3/advanced/hud.html">HUD</a>, com.jme3.font.*, com.jme3.ui.Picture, guiNode.attachChild()
  466. <br/>
  467. <strong>Code sample:</strong> <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://code.google.com/p/jmonkeyengine/source/browse/trunk/engine/src/test/jme3test/gui/TestOrtho.java"><param name="text" value="<html><u>TestOrtho.java</u></html>"><param name="textColor" value="blue"></object>, <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://code.google.com/p/jmonkeyengine/source/browse/trunk/engine/src/test/jme3test/gui/TestBitmapFont.java"><param name="text" value="<html><u>TestBitmapFont.java</u></html>"><param name="textColor" value="blue"></object> |
  468. </p>
  469. </div>
  470. <!-- EDIT49 SECTION "How do I display score, health, mini-maps, status icons?" [22462-23054] -->
  471. <h3><a>How do I display buttons and UI controls?</a></h3>
  472. <div>
  473. <p>
  474. You may want to display buttons to let the player switch between the game, settings screen, and score screens. For buttons and other more advanced UI controls, jME supports the Nifty <acronym title="Graphical User Interface">GUI</acronym> library.
  475. <br/>
  476. <strong>Learn more:</strong> <a href="/com/jme3/gde/docs/jme3/advanced/nifty_gui.html">Nifty GUI</a>
  477. <br/>
  478. Sample Code: <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://code.google.com/p/jmonkeyengine/source/browse/trunk/engine/src/test/jme3test/niftygui/TestNiftyGui.java"><param name="text" value="<html><u>TestNiftyGui.java</u></html>"><param name="textColor" value="blue"></object>
  479. </p>
  480. </div>
  481. <!-- EDIT50 SECTION "How do I display buttons and UI controls?" [23055-23499] -->
  482. <h3><a>How do i display a loading screen?</a></h3>
  483. <div>
  484. <p>
  485. Instead of having a frozen frame while your games loads, you can have a loading screen while it loads.
  486. <br/>
  487. <strong>Learn more:</strong> <a href="/com/jme3/gde/docs/jme3/advanced/loading_screen.html">Loading screen</a>
  488. </p>
  489. </div>
  490. <!-- EDIT51 SECTION "How do i display a loading screen?" [23500-23716] -->
  491. <h2><a>Nifty GUI</a></h2>
  492. <div>
  493. </div>
  494. <!-- EDIT52 SECTION "Nifty GUI" [23717-23738] -->
  495. <h3><a>I get NoSuchElementException when adding controls (buttons etc)!</a></h3>
  496. <div>
  497. <p>
  498. Verify that you include a controls definition file link in your <acronym title="Extensible Markup Language">XML</acronym>: This is the default:
  499. </p>
  500. <pre><span>&lt;useControls filename=&quot;nifty-default-controls.xml&quot;/&gt;</span></pre>
  501. </div>
  502. <!-- EDIT53 SECTION "I get NoSuchElementException when adding controls (buttons etc)!" [23739-23974] -->
  503. <h3><a>Where can I find example code of Nifty GUI&#039;s XML and Java classes?</a></h3>
  504. <div>
  505. <p>
  506. <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://nifty-gui.svn.sourceforge.net/viewvc/nifty-gui/nifty-examples/trunk/src/main/"><param name="text" value="<html><u>http://nifty-gui.svn.sourceforge.net/viewvc/nifty-gui/nifty-examples/trunk/src/main/</u></html>"><param name="textColor" value="blue"></object>
  507. </p>
  508. </div>
  509. <!-- EDIT54 SECTION "Where can I find example code of Nifty GUI's XML and Java classes?" [23975-24137] -->
  510. <h3><a>Is there Java Doc for Nifty GUI?</a></h3>
  511. <div>
  512. <p>
  513. <a href="/com/jme3/gde/docs/jme3/advanced/nifty_gui_java_interaction#useful_links.html">Nifty GUI 1.3 Java docs</a>
  514. </p>
  515. </div>
  516. <!-- EDIT55 SECTION "Is there Java Doc for Nifty GUI?" [24138-24263] -->
  517. <h2><a>I want to create an environment with sounds, effects, and landscapes</a></h2>
  518. <div>
  519. </div>
  520. <!-- EDIT56 SECTION "I want to create an environment with sounds, effects, and landscapes" [24264-24344] -->
  521. <h3><a>How do I play sounds and noises?</a></h3>
  522. <div>
  523. <p>
  524. Use AudioRenderer, Listener, and AudioNode from com.jme3.audio.*.
  525. <br/>
  526. <strong>Learn more:</strong> <a href="/com/jme3/gde/docs/jme3/beginner/hello_audio.html">Hello Audio</a>, <a href="/com/jme3/gde/docs/jme3/advanced/audio.html">Audio</a>
  527. <br/>
  528. <strong>Code sample:</strong> <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://code.google.com/p/jmonkeyengine/source/browse/trunk/engine/src/test/jme3test/audio"><param name="text" value="<html><u>audio</u></html>"><param name="textColor" value="blue"></object>
  529. </p>
  530. </div>
  531. <!-- EDIT57 SECTION "How do I play sounds and noises?" [24345-24648] -->
  532. <h3><a>How do I make fire, smoke, explosions, swarms, magic spells?</a></h3>
  533. <div>
  534. <p>
  535. For swarm like effects you use particle emitters.
  536. <br/>
  537. <strong>Learn more:</strong> <a href="/com/jme3/gde/docs/jme3/beginner/hello_effects.html">Hello Effects</a>, <a href="/com/jme3/gde/docs/jme3/advanced/particle_emitters.html">Particle Emitters</a>, <a href="/com/jme3/gde/docs/jme3/advanced/bloom_and_glow.html">Bloom and Glow</a>, <a href="/com/jme3/gde/docs/jme3/advanced/effects_overview.html">Effects Overview</a>, com.jme3.effect.EmitterSphereShape, com.jme3.effect.ParticleEmitter
  538. <br/>
  539. <strong>Code sample:</strong> <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://code.google.com/p/jmonkeyengine/source/browse/trunk/engine/src/test/jme3test/fx/TestExplosionEffect.java"><param name="text" value="<html><u>TestExplosionEffect.java</u></html>"><param name="textColor" value="blue"></object>, <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://code.google.com/p/jmonkeyengine/source/browse/trunk/engine/src/test/jme3test/fx/TestParticleEmitter.java"><param name="text" value="<html><u>TestParticleEmitter.java</u></html>"><param name="textColor" value="blue"></object>
  540. </p>
  541. </div>
  542. <!-- EDIT58 SECTION "How do I make fire, smoke, explosions, swarms, magic spells?" [24649-25304] -->
  543. <h3><a>How do I make water, waves, reflections?</a></h3>
  544. <div>
  545. <p>
  546. Use a special post-processor renderer from com.jme3.water.*.
  547. <br/>
  548. <strong>Learn more:</strong> <a href="/com/jme3/gde/docs/jme3/advanced/water.html">Water</a>, <a href="/com/jme3/gde/docs/jme3/advanced/post-processor_water.html">Post-Processor Water</a>
  549. <br/>
  550. <strong>Code sample:</strong> <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://code.google.com/p/jmonkeyengine/source/browse/trunk/engine/src/test/jme3test/water/TestSimpleWater.java"><param name="text" value="<html><u>TestSimpleWater.java</u></html>"><param name="textColor" value="blue"></object>, <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://code.google.com/p/jmonkeyengine/source/browse/trunk/engine/src/test/jme3test/water/TestSceneWater.java"><param name="text" value="<html><u>TestSceneWater.java</u></html>"><param name="textColor" value="blue"></object>, <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://code.google.com/p/jmonkeyengine/source/browse/trunk/engine/src/test/jme3test/water/TestPostWaterLake.java"><param name="text" value="<html><u>TestPostWaterLake.java</u></html>"><param name="textColor" value="blue"></object>, <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://code.google.com/p/jmonkeyengine/source/browse/trunk/engine/src/test/jme3test/water/TestPostWater.java"><param name="text" value="<html><u>TestPostWater.java</u></html>"><param name="textColor" value="blue"></object>
  551. </p>
  552. </div>
  553. <!-- EDIT59 SECTION "How do I make water, waves, reflections?" [25305-26065] -->
  554. <h3><a>How do I make fog, bloom, blur, light scattering?</a></h3>
  555. <div>
  556. <p>
  557. Use special post-processor renderers from com.jme3.post.*.
  558. <br/>
  559. <strong>Learn more:</strong> <a href="/com/jme3/gde/docs/jme3/advanced/effects_overview.html">effects_overview</a>
  560. </p>
  561. </div>
  562. <!-- EDIT60 SECTION "How do I make fog, bloom, blur, light scattering?" [26066-26240] -->
  563. <h3><a>How do I generate a terrain?</a></h3>
  564. <div>
  565. <p>
  566. Use com.jme3.terrain.*. The JMonkeyEngine also provides you with a Terrain Editor plugin.
  567. <br/>
  568. <strong>Learn more:</strong> <a href="/com/jme3/gde/docs/jme3/beginner/hello_terrain.html">Hello Terrain</a>, <a href="/com/jme3/gde/docs/jme3/advanced/terrain.html">Terrain</a>, <a href="/com/jme3/gde/docs/sdk/terrain_editor.html">Terrain Editor</a>
  569. <br/>
  570. <strong>Code sample:</strong> <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://code.google.com/p/jmonkeyengine/source/browse/trunk/engine/src/test/jme3test/terrain/TestTerrain.java"><param name="text" value="<html><u>TestTerrain.java</u></html>"><param name="textColor" value="blue"></object>
  571. </p>
  572. </div>
  573. <!-- EDIT61 SECTION "How do I generate a terrain?" [26241-26624] -->
  574. <h3><a>How do I make a sky?</a></h3>
  575. <div>
  576. <p>
  577. <strong>Code sample:</strong> <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://code.google.com/p/jmonkeyengine/source/browse/trunk/engine/src/test/jme3test/texture/TestCubeMap.java"><param name="text" value="<html><u>TestCubeMap.java</u></html>"><param name="textColor" value="blue"></object>
  578. </p>
  579. <pre>rootNode.attachChild&#40;SkyFactory.createSky&#40; assetManager,
  580. &quot;Textures/Sky/Bright/BrightSky.dds&quot;, false&#41;&#41;;
  581. skyGeo.setQueueBucket&#40;Bucket.Sky&#41; </pre>
  582. <p>
  583. <strong>Learn more:</strong> <a href="/com/jme3/gde/docs/jme3/advanced/sky.html">Sky</a>
  584. </p>
  585. </div>
  586. <!-- EDIT62 SECTION "How do I make a sky?" [26625-2

Large files files are truncated, but you can click here to view the full file