| 1234567891011121314151617181920 |
- <!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"><title>Models and Scenes</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"></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/advanced/3d_models.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/advanced/"><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>Models and Scenes</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="#using-models-and-scenes-with-jme3">Using Models and Scenes with jME3</a></li><li><a href="#creating-models-and-scenes">Creating Models and Scenes</a></li></ul></div></div><div id="content"><div id="preamble"><div class="sectionbody"><div class="paragraph"><p>Like <a href="../../jme3/advanced/shape.html">Shape</a>s, 3D models are also made up of <a href="../../jme3/advanced/mesh.html">Mesh</a>es, but models are more complex than Shapes. While Shapes are built into jME3, you typically create models in external 3D Mesh Editors.</p></div></div></div>
- <div class="sect1"><h2 id="using-models-and-scenes-with-jme3">Using Models and Scenes with jME3</h2><div class="sectionbody"><div class="paragraph"><p>To use 3D models in a jME3 application:</p></div>
- <div class="olist arabic"><ol class="arabic"><li><p>Export the 3D model in Ogre XML or Wavefront OBJ format. Export Scenes as Ogre DotScene format.</p></li><li><p>Save the files into a subdirectory of your jME3 project’s <code>assets</code> directory.</p></li><li><p>In your code, you use the <a href="../../jme3/advanced/asset_manager.html">Asset Manager</a> to load models as <a href="../../jme3/advanced/spatial.html">Spatial</a>s into a jME application.</p></li></ol></div>
- <div class="listingblock"><div class="content"><pre>Spatial model = assetManager.loadModel(
- "Models/MonkeyHead/MonkeyHead.mesh.xml" );</pre></div></div>
- <div class="olist arabic"><ol class="arabic"><li><p>(For the release build:) Use the jMonkeyEngine SDK to convert models to .j3o format. You don’t need this step as long you still develop and test the aplication within the jMonkeyEngine SDK.</p></li></ol></div></div></div>
- <div class="sect1"><h2 id="creating-models-and-scenes">Creating Models and Scenes</h2><div class="sectionbody"><div class="paragraph"><p>To create 3D models and scenes, you need a 3D Mesh Editor such as <a href="http://www.blender.org/">Blender</a>, with an OgreXML Exporter plugin.</p></div>
- <div class="paragraph"><p><strong>Tip:</strong> Learn how to create <a href="http://en.wikibooks.org/wiki/Blender_3D:_Noob_to_Pro/UV_Map_Basics">UV textures</a> for more complex models, it looks more professional.</p></div>
- <div class="paragraph"><p>3D model editors are third-party products, so please consult their documentation for instructions how to use them. Here is an example workflow for Blender users:</p></div>
- <div class="ulist"><ul><li><p><a href="../../jme3/external/blender.html">Creating jME3 compatible 3D models in Blender</a></p></li></ul></div>
- <div class="paragraph"><p>To export your models as Ogre XML meshes with materials:</p></div>
- <div class="olist arabic"><ol class="arabic"><li><p>Open the menu File > Export > OgreXML Exporter to open the exporter dialog.</p></li><li><p>In the Export Materials field: Give the material the same name as the model. For example, the model <code>something.mesh.xml</code> goes with <code>something.material</code>, plus (optionally) <code>something.skeleton.xml</code>, and some JPG files.</p></li><li><p>In the Export Meshes field: Select a target subdirectory of your <code>assets/Models/</code> directory. E.g. <code>assets/Models/something/</code>.</p></li><li><p>Activate the following exporter settings:</p><div class="ulist"><ul><li><p>Copy Textures: YES</p></li><li><p>Rendering Materials: YES</p></li><li><p>Flip Axis: YES</p></li><li><p>Require Materials: YES</p></li><li><p>Skeleton name follows mesh: YES</p></li></ul></div></li><li><p>Click export.</p></li></ol></div>
- <div class="paragraph"><p>You can now use the <a href="../../sdk.html">jMonkeyEngine SDK</a> to <a href="../../sdk/model_loader_and_viewer.html">load and view models</a>. You can <a href="../../sdk/scene_composer.html">create scenes</a> from them and write code that loads them into your application.</p></div></div></div></div><div id="footer"><div id="footer-text">Version <br>Last updated 2016-07-22 07:15:15 UTC</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>
|