= jMonkeyEngine 教程 & 文档
:author: 
:revnumber: 
:revdate: 2016/03/17 20:48
:keywords: documentation, intro, intermediate, about
ifdef::env-github,env-browser[:outfilesuffix: .adoc]



== 初级教程

初级教程将介绍一些常见的游戏开发实例，并解释一些基本概念。在正式学习前，请确认自己是否了解<<jme3/terminology#,3D游戏开发的一些基本概念>>，例如<<jme3/the_scene_graph#,场景图>>。如果你不太了解的话，建议先学习“<<jme3/math_for_dummies#,3D数学基础知识>>”以及“<<jme3/scenegraph_for_dummies#,3D场景图的基本概念>>”。

link:https://github.com/jMonkeyEngine/jmonkeyengine/tree/master/jme3-examples/src/main/java/jme3test[所有示例代码]均已包含在jMonkeyEngine SDK中（yan：通过github搜索jMonkeyEngine也能找到源码），你只需要在创建工程时选择`JmeTests`模板，即可查阅这些代码。如果你要自己开发游戏的话，建议在创建工程时选择`BasicGame`模板。

建议读者在学习的过程中把所有的示例代码都编写运行一遍，并且尝试着去修改这些代码，有助于加深对本教程的理解。


[IMPORTANT]
====
 * 使用<<sdk#,jMonkeyEngine SDK>>开发项目时，按F1键可以搜索并浏览本wiki的一份副本，帮助文档的内容与你所使用的SDK版本同步。本wiki随link:https://github.com/jMonkeyEngine/jmonkeyengine[jME3最新版本]同步更新。* 
====



image::jme3/beginner/beginner-physics.png[beginner-physics.png,with="360",height="291",align="right"]


.  <<jme3/beginner/hello_simpleapplication_zh#,第一个JME3程序>> – 实现一个简单的程序
..  <<jme3/beginner/hello_node_zh#,节点(Node)>> – 在场景图中改变几何体和节点属性
..  <<jme3/beginner/hello_asset_zh#,资源(Assets)>> – 加载三维模型、场景和其他的资源
..  <<jme3/beginner/hello_main_event_loop_zh#,事件循环(Loop)>> – 在事件循环中实现事件控制功能
..  <<jme3/beginner/hello_input_system_zh#,输入(Input)>> – 对于键盘和鼠标的输入作出响应
..  <<jme3/beginner/hello_material_zh#,材质(Material)>> – 设置材质、纹理、透明度
..  <<jme3/beginner/hello_animation_zh#,动画(Animation)>> – 控制动画模型
..  <<jme3/beginner/hello_picking_zh#,拣选(Picking)>> – 射击、压下按钮、选择、捡起选项
..  <<jme3/beginner/hello_collision_zh#,碰撞(Collision)>> – 建造墙壁和固体地板
..  <<jme3/beginner/hello_terrain_zh#,地形(Terrain)>> – 使用贴图创建小山的风景
..  <<jme3/beginner/hello_audio_zh#,音效(Audio)>> – 按照位置和事件来实现三维音效
..  <<jme3/beginner/hello_effects_zh#,特效(Effects)>> – 创建粒子特效，比如：火焰、爆炸、魔法
..  <<jme3/beginner/hello_physics_zh#,物理(Physics)>> – 撞球和坠落的砖头
..  <<jme3/beginner/hello_vector_zh#,向量(Vector)>> – 可视化向量与向量操作
..  <<jme3/beginner/hello_chase_camera_zh#,摄像机(Camera)>> – aka的第三人称摄像机示例代码

See also: <<sdk/sample_code#,运行示例代码遇到了问题吗>>?

For more help getting started, check out this tuts+ guide on “link:http://gamedevelopment.tutsplus.com/articles/how-to-learn-jmonkeyengine-3--gamedev-10479[ How to learn jMonkeyEngine 3].


== 中级教程

学初级教程后，你已经了解了所有的基本概念，是时候把它们综合起来了。下面这些文章可以帮助你理解如何在实践开发中综合应用这些知识。

*jMonkeyEngine3 概念*

*  <<jme3/intermediate/best_practices#,最佳实践>>
*  <<jme3/intermediate/simpleapplication#,深入SimpleApplication类>>
*  <<jme3/intermediate/appsettings#,jME3显示配置>>
*  <<jme3/intermediate/file_types#,文件类型>>
*  <<jme3/intermediate/optimization#,优化>>
*  <<jme3/faq#,常见问题解答(FAQ)>>

*数学概念*

*  <<jme3/math_for_dummies#,jME3数学基础>>
*  <<jme3/intermediate/math#,Short 3D math &quot;cheat sheet&quot;>>
*  <<jme3/math#,jME3数学概述>>
*  <<jme3/math_video_tutorials#,视频: jME3数学系列教程>>

*3D图形学概念*

*  <<jme3/intermediate/multi-media_asset_pipeline#,多媒体资源管道>>
*  <<jme3/scenegraph_for_dummies#,3D场景图的基本概念>>
*  <<jme3/terminology#,3D图形学术语>>
*  <<jme3/intermediate/how_to_use_materials#,如何使用材质>>
*  <<jme3/intermediate/transparency_sorting#,透明度排序>>
*  <<jme3/external/blender#,使用Blender创建兼容jME3的模型>>
*  <<jme3/external/3dsmax#,使用3dsmax创建兼容jME3的模型>>

*游戏教程*

*  link:http://gamedevelopment.tutsplus.com/series/cross-platform-vector-shooter-jmonkeyengine--gamedev-13757[Neon Vector Shooter tutorial on Tuts+]

*视频实例教程*
- 注意：以下视频中使用了jME 3.1 alpha 版的一些特性

*  link:http://www.youtube.com/watch?v=-OzRZscLlHY[Video: jMonkeyEngine SDK Use Case Demo 1 (Quixote)]
*  link:http://www.youtube.com/watch?v=6-YWxD3JByE[Video: jMonkeyEngine SDK Use Case Demo 2 (Models and Materials)]

Learn from sample code in link:https://github.com/jMonkeyEngine/jmonkeyengine/tree/master/jme3-examples/src/main/java/jme3test[src/main/java/jme3test] (also available in the sdk by File &gt; New Project &gt; JME3 Tests) and the example games provided by the community!


== 进阶教程

现在你已经学会了所有的概念，是时候学习jMonkeyEngine的全部内容了！深入到API中去了解所有的选项，包括那些不太常用的高级方法。但是不要过度延长自己，开发游戏需要时间和奉献精神，一步一个脚印，战士！ :)

*控制游戏逻辑*

*  <<jme3/advanced/update_loop#,主循环>>
*  <<jme3/advanced/application_states#,AppStates>>
*  <<jme3/advanced/custom_controls#,自定义Control>>
**  link:http://www.youtube.com/watch?v=MNDiZ9YHIpM[Video: How to control any scene node]
**  link:http://www.youtube.com/watch?v=-OzRZscLlHY[Video: How to remote control a character in a scene]

*  <<jme3/advanced/multithreading#,多线程>>

*管理3D场景图中的对象*

*  <<jme3/advanced/traverse_scenegraph#,遍历场景图>>
*  <<jme3/advanced/spatial#,Spatial: Node与Geometry的对比>>
*  <<jme3/advanced/mesh#,网格>>
**  <<jme3/advanced/shape#,形状>>
**  <<jme3/advanced/3d_models#,3D模型>>
**  <<jme3/advanced/custom_meshes#,自定义网格>>

*  <<jme3/advanced/asset_manager#,资源管理器>>
*  <<jme3/advanced/save_and_load#,读写节点数据(.J3O文件)>>
*  <<jme3/advanced/collision_and_intersection#,碰撞与交点>>
*  <<jme3/advanced/level_of_detail#,层次细节(LOD)>>

*动画和场景*

*  <<jme3/advanced/animation#,Animation>>
*  <<jme3/advanced/cinematics#,Cinematics (cutscenes, fake destruction physics)>>
*  <<jme3/advanced/motionpath#,MotionPaths and waypoints>>
*  <<jme3/external/blender#,Creating jME3 compatible 3D models in Blender>>
*  <<jme3/advanced/makehuman_blender_ogrexml_toolchain#,MakeHuman Blender OgreXML toolchain for creating and importing animated human characters>>
*  <<sdk/blender#,Converting Blender Models to JME3 (.J3o files)>>
**  link:https://www.youtube.com/watch?v=QiLCs4AKh28[Video: Import animated models from Blender 2.6 to JME3]
**  link:http://www.youtube.com/watch?v=NdjC9sCRV0s[Video: Creating and Exporting OgreXML Animations from Blender 2.61 to JME3]
**  link:https://docs.google.com/fileview?id=0B9hhZie2D-fENDBlZDU5MzgtNzlkYi00YmQzLTliNTQtNzZhYTJhYjEzNWNk&hl=en[Scene Workflow:]


Create jme3 compatible racing tracks in blender
* link:http://www.youtube.com/watch?v=3481ueuDJwQ&feature=youtu.be[Video: Create jme3 compatible models in blender]

Exporting OgreXML scenes from Blender to JME3

*  link:https://docs.google.com/leaf?id=0B9hhZie2D-fEYmRkMTYwN2YtMzQ0My00NTM4LThhOTYtZTk1MTRlYTNjYTc3&hl=en[Animation Workflow: Create Animated UV-Mapped OgreXML Models in Blender, and use them in JME3]
**  link:http://www.youtube.com/watch?v=IDHMWsu_PqA[Video: Creating Worlds with Instances in Blender]
**  <<jme3/advanced/ogrecompatibility#,OgreCompatibility>>

*材质、光影*

*  <<jme3/intermediate/how_to_use_materials#,How to Use Materials>>
*  <<jme3/advanced/j3m_material_files#,Creating .j3m Materials>>
*  <<jme3/advanced/material_definitions#,How to Use Material Definitions (.j3md)>>
*  <<jme3/advanced/materials_overview#,All Material Definition Properties>>
*  <<jme3/advanced/anisotropic_filtering#,Anisotropic Filtering for Textures>>
*  <<jme3/advanced/light_and_shadow#,Light and Shadow>>
*  <<jme3/advanced/jme3_shaders#,About JME3 and Shaders>>
*  <<jme3/advanced/jme3_shadernodes#,Shader Node System>>
*  <<jme3/advanced/jme3_srgbpipeline#,Gamma correction or sRGB pipeline>>
*  <<jme3/shader_video_tutorials#,Videos: jME3 introduction to shaders video tutorial series>>
*  link:http://www.youtube.com/watch?v=IuEMUFwdheE[Video: jME3 Material with Alpha Channel]

*物理集成*

*  <<jme3/advanced/physics#,Physics: Gravity, Collisions, Forces>>
*  <<jme3/advanced/bullet_multithreading#,Multi-Threaded Physics>>
*  <<jme3/advanced/physics_listeners#,Physics Listeners and Collision Detection>>
*  <<jme3/advanced/hinges_and_joints#,Hinges and Joints>>
*  <<jme3/advanced/walking_character#,Walking Character>>
*  <<jme3/advanced/ragdoll#,Ragdoll>>
*  <<jme3/advanced/vehicles#,Vehicles>>
*  <<jme3/advanced/ray_and_sweep_tests#,Physics Rays and Sweep Tests>>
*  link:http://www.youtube.com/watch?v=yS9a9o4WzL8[Video: Mesh Tool &amp; Physics Editor]

*音频和视频*

*  <<jme3/advanced/audio#,Audio: Playing Sounds>>
*  <<jme3/advanced/audio_environment_presets#,Audio Environment Presets>>
*  <<jme3/advanced/video#,Video: Playing Clips>>
*  <<jme3/advanced/screenshots#,Capture Screenshots>>
*  <<jme3/advanced/capture_audio_video_to_a_file#,Capture Audio/Video to a File>>

*后置处理过滤器与特效*

*  <<jme3/advanced/effects_overview#,Effects and Filters Overview>>
*  <<jme3/advanced/bloom_and_glow#,Bloom and Glow>>
*  <<jme3/advanced/particle_emitters#,Particle Emitters>>

*地形*

*  <<jme3/advanced/sky#,Sky>>
*  <<jme3/advanced/terrain#,Terrain (TerraMonkey)>>
*  <<jme3/advanced/endless_terraingrid#,Endless Terrain (TerrainGrid)>>
*  <<jme3/advanced/terrain_collision#,Terrain Collision>>
*  <<jme3/contributions/cubes#,Cubes - A Block World Framework>>
*  <<jme3/advanced/water#,Simple Water>>
*  <<jme3/advanced/post-processor_water#,Post-Processor Water (SeaMonkey)>>
*  <<jme3/contributions/vegetationsystem#,Vegetation System>>

*人工智能(AI)*

*  <<jme3/advanced/recast#,Recast Navigation>>
*  <<jme3/advanced/building_recast#,Updating and building Recast Native Bindings>>
*  <<jme3/advanced/monkey_brains#,Monkey Brains>>
*  <<jme3/advanced/steer_behaviours#,Steer Behaviours>>

*多人联网游戏*

*  <<jme3/advanced/networking#,Multiplayer Networking (SpiderMonkey)>>
*  <<jme3/advanced/headless_server#,Headless Server>>
*  <<jme3/advanced/monkey_zone#,Monkey Zone: Multi-Player Demo Code>>
*  <<jme3/advanced/open_game_finder#,Open Game Finder>>
*  <<jme3/advanced/networking_video_tutorials#,Videos: jME3 networking video tutorial series>> 

*实体系统*

*  <<jme3/contributions/entitysystem#, The Zay-ES Entity System>>

*摄像机*

*  <<jme3/advanced/camera#,Camera>>
*  <<jme3/advanced/making_the_camera_follow_a_character#,Making the Camera Follow a Character>>
*  <<jme3/advanced/remote-controlling_the_camera#,Remote-Controlling the Camera>>
*  <<jme3/advanced/multiple_camera_views#,Multiple Camera Views>> 

*用户交互*

*  <<jme3/advanced/input_handling#,Input Handling>>
**  link:https://github.com/jMonkeyEngine-Contributions/Lemur/wiki/Modules[Lemur Scene Graph Tools]
***  link:http://hub.jmonkeyengine.org/t/lemur-gems-1-inputmapper-based-camera-movement/28703[Lemur Gems #1 - Input mapper based camera movement. ]
***  link:http://hub.jmonkeyengine.org/t/lemur-gems-2-inputmapper-delegates/28710[Lemur Gems #2 - Input mapper delegates]
***  link:http://hub.jmonkeyengine.org/t/lemur-gems-3-scene-picking/28713[Lemur Gems #3 - Scene picking]


*  <<jme3/advanced/combo_moves#,Combo Moves>>
*  <<jme3/advanced/mouse_picking#,Mouse Picking: Click to Select>>

*图形用户界面(+++<abbr title="Graphical User Interface">GUI</abbr>+++)*

*  link:https://github.com/jMonkeyEngine-Contributions/Lemur[Lemur - a native jME3 GUI library with scene graph tools]
*  <<jme3/contributions/tonegodgui#,tonegodGUI - a native jME3 GUI library>>
*  <<jme3/advanced/nifty_gui#,Nifty GUI - JME3 Integration Tutorial>>
*  <<jme3/advanced/nifty_gui_best_practices#,Nifty GUI - Best Practices>>
*  <<jme3/advanced/nifty_gui_scenarios#,Nifty GUI Scenarios (Load Screen etc)>>
*  <<jme3/advanced/hud#,Head-Up Display (HUD)>>
*  <<jme3/advanced/localization#,Localization>>
*  <<jme3/advanced/swing_canvas#,Swing Canvas>>

*自定义渲染*

*  <<jme3/advanced/jme3_forwardrendering#,Forward Rendering process>>
*  <<jme3/advanced/jme3_renderbuckets#,Render Buckets>>

*自定义工具*

*  <<jme3/tools/navigation#,Mercator Projection Tool (Marine Navigation)>>
*  <<jme3/tools/charts#,Visualizing Maps in JME3 (Marine Charts)>>
*  <<jme3/advanced/atom_framework#,Atom framework. Mash-up of other plugins>>

*日志与调试*

*  <<jme3/advanced/logging#,Logging>>
*  <<sdk/log_files#,Log Files>>
*  <<jme3/advanced/read_graphic_card_capabilites#,Read Graphic Card Capabilites>>
*  <<jme3/advanced/debugging#,Debugging with Wireframes>>

*Android项目开发*

*  <<jme3/advanced/android#,Android Project Cheat Sheet>>

*项目部署*

*  <<jme3/android#,Android>>
*  <<sdk/application_deployment#,Application Deployment (using jMonkeyEngine SDK)>>
*  <<jme3/webstart#,WebStart Deployment (without jMonkeyEngine SDK)>>

*脚本*

*  <<jme3/scripting#, Groovy 脚本语言>>

*虚拟现实&amp;模拟器*

*  <<jme3/virtualreality#, Virtual Reality. OpenCV &amp; JavaCV>>

*jMonkey User Contributions*

*  <<jme3/contributions#, Contributions - User made utilities to add functionality to the engine.>>

*Sample Projects*

*  <<sdk/sample_code#,JmeTests>> – The “official sample project JmeTests.
*  link:http://code.google.com/p/jmonkeyengine/source/browse/BookSamples/#BookSamples%2Fsrc[BookSamples] – Some more jME3 code samples

These code examples are not supported by the core team and we cannot guarantee their correctness:

*  <<jme3/user_examples_project#,User Examples Project>> – The jME3 users examples project.
*  <<jme3/shaderblow_project#,ShaderBlow Project>> – The jME3 users shaders project.
*  <<jme3/rise_of_mutants_project#,Rise of Mutants Project>> – Rise of Mutants Project by BigBoots Team.
*  <<jme3/atomixtuts#,atomixtuts>> – Atomix Tutorial Series
*  link:http://code.google.com/p/street-rally-3d/source/browse/#svn%2Ftrunk%2Fsrc%2Fsr3d[Street rally 3d source code] – A racing game programmed by rhymez.


== SDK Documentation


image::sdk/jmonkeyplatform-docu-2.png[jmonkeyplatform-docu-2.png,with="420",height="300",align="right"]


The <<sdk#,jMonkeyEngine SDK>> is our recommended game development environment.

*  <<sdk/comic#,jMonkeyEngine SDK - the Comic>>
*  <<sdk#,SDK Documentation (All editors, plugins, etc)>>

Here are some videos of how the jMonkeyEngine SDK makes your development team's life easier:

*  link:http://www.youtube.com/watch?v=nL7woH40i5c[Video: Importing Models]
*  link:http://www.youtube.com/watch?v=ntPAmtsQ6eM[Video: Scene Composing]
*  link:http://www.youtube.com/watch?v=DUmgAjiNzhY[Video: Dragging&amp;Dropping Nodes]
*  link:http://www.youtube.com/watch?v=Feu3-mrpolc[Video: Working with Materials]
*  link:http://www.youtube.com/watch?v=oZnssg8TBWQ[Video: WebStart Deployment]
*  link:http://www.youtube.com/watch?v=MNDiZ9YHIpM[Video: Custom Controls]
*  Read the <<sdk#,SDK documentation>> for details.


== 下载和安装JME3

*  <<bsd_license#,Use jMonkeyEngine 3 for free under the BSD License>>
*  <<jme3/requirements#,Software and hardware requirements>>
*  <<jme3/features#,All Supported Features>>
*  <</#Installation,Download jMonkeyEngine 3 SDK>>


== Feedback

jME3 is in development; if a tutorial doesn't work as expected, try using the latest daily build. If that doesn't “fix it then:

*  link:http://code.google.com/p/jmonkeyengine/issues/list?can=2&q=label:Component-Docs[Report a Documentation Task]
*  <<report_bugs#,Report a Bug>>
*  link:http://jmonkeyengine.org/forums[Ask (and Answer!) Questions on the Forum]
