Explorar o código

Proofread gridmaps tutorial and add it to toctree

_3d_physics is probably not the best match, but we should probably
reviewed the 3D categories.
Rémi Verschelde %!s(int64=9) %!d(string=hai) anos
pai
achega
41ebea6d88
Modificáronse 3 ficheiros con 91 adicións e 65 borrados
  1. 1 0
      tutorials/3d/_3d_physics.rst
  2. 0 65
      tutorials/3d/gridmap.rst
  3. 90 0
      tutorials/3d/using_gridmaps.rst

+ 1 - 0
tutorials/3d/_3d_physics.rst

@@ -6,3 +6,4 @@ Physics
    :name: toc-3d-physics
 
    ../ray-casting
+   using_gridmaps

+ 0 - 65
tutorials/3d/gridmap.rst

@@ -1,65 +0,0 @@
-.. _doc_using_gridmaps:
-
-Using gridmaps
-~~~~~~~~~~~~~~
-
-Introduction
-------------
-
-Gridmap is a simple and quick way to create 3D game levels. Think it as a 3D version of tilemap. Similarly, you start with a set of 3D meshes that can be put in a grid, it's like playing with unlimited among of Lego.
-
-Collisions can also be added to the meshes.
-
-Creating a meshlibrary 
-----------------
-
-To begin, you need a meshlibrary. Here are some meshes for creating it.
-
-.. image:: /img/meshes.png
-
-Open a new scene and create a root node(this is important, without the root node, it will not export!). Then, create a meshInstance node.
-
-.. image:: /img/mesh_meshlib.png
-
-If you don't need to apply physics to the building blocks. That's all you need to do. Usually you will need to add physics, let's try to add it.
-
-Collision
----------
-
-There are two ways to give the meshes a collision shape and physicsBody, you either add it when creating the meshLibrary or edit the meshLibrary inside the Gridmap node(only collision shape can be set, therefore, it's necessary to define the physicsBody when creating the meshLibrary. Let's go by the former method.
-
-To give the meshes a collision shape. You simply add more nodes to the meshInstance node. You add the desired physicsBody and collision shape in this order: 
-
-.. image:: /img/collide_mesh_meshlib.png
-
-You can adjust the order according to your needs.
-
-To export, go to scene>covert to>meshLibrary
-
-.. image:: /img/export_meshlib.png
-
-You are now ready to use the Gridmap node.
-
-Using the MeshLibrary in a GridMap
-------------------------------
-
-Create a new scene, use any node as root, then create a Gridmap node. Then, load the specific MeshLibrary.
-
-.. image:: /img/load_meshlib.png
-
-Now, you can build your own world in whatever way you wish. Leftclick to add and rightclick to remove. You can adjust the floor when you need to put some meshes at specific height.
-
-.. image:: /img/gridmap.png
-
-As mention above, you can define the collision shape ins this stage, do the following steps:
-
-.. image:: /img/load_collisionshape.png
-
-Ta Da.
-
-Reminder
-------------------------------
-
-- Beware of the scale of the meshes, if you are not using uniform meshes.
-
-- There are many ways to make use of the Gridmap, be creative.

+ 90 - 0
tutorials/3d/using_gridmaps.rst

@@ -0,0 +1,90 @@
+.. _doc_using_gridmaps:
+
+Using gridmaps
+~~~~~~~~~~~~~~
+
+Introduction
+------------
+
+:ref:`Gridmaps <class_GridMap>` are a simple and fast way to create 3D
+game levels. Think of it as a 3D version of the :ref:`TileMap<doc_using_tilemaps>`
+node. Similarly, you start with a predefined library of 3D meshes that
+can be put on a grid, just like if you were building a level with an
+unlimited amount of Lego blocks.
+
+Collisions can also be added to the meshes, just like you would do with
+the tiles of a tilemap.
+
+Creating a MeshLibrary
+----------------------
+
+To begin, you need a :ref:`class_MeshLibrary`, which is a collection
+of meshes that can be used in the gridmap. Here are some meshes you can
+use to set it up.
+
+.. image:: /img/meshes.png
+
+Open a new scene and create a root node (this is important, as without
+the root node, it will not be able to generate the MeshLibrary!). Then,
+create a :ref:`class_MeshInstance` node:
+
+.. image:: /img/mesh_meshlib.png
+
+If you don't need to apply physics to the building blocks, that's all
+you need to do. In most cases though, you will need your block to
+generate collisions, so let's see how to add them.
+
+Collisions
+----------
+
+To assign a :ref:`class_CollisionShape` and :ref:`class_PhysicsBody`
+to the meshes, the simplest way is to do it while creating the
+MeshLibrary. Alternatively, you can also edit an existing MeshLibrary
+from within the GridMap inspector, but only CollisionShapes can be
+defined there and not PhysicsBody.
+
+To give the meshes a CollisionShape, you simply add children nodes to
+the MeshInstance node. You would typically add the desired PhysicsBody
+and CollisionShape in this order:
+
+.. image:: /img/collide_mesh_meshlib.png
+
+You can adjust the order according to your needs.
+
+Exporting the MeshLibrary
+-------------------------
+
+To export, go to ``Scene > Convert To.. > MeshLibrary..``, and save it
+as a resource.
+
+.. image:: /img/export_meshlib.png
+
+You are now ready to use the GridMap node.
+
+Using the MeshLibrary in a GridMap
+----------------------------------
+
+Create a new scene using any node as root, then add a Gridmap node.
+Then, load the MeshLibrary that you just exported.
+
+.. image:: /img/load_meshlib.png
+
+Now, you can build your own level as you see best fit. Use left click
+to add tiles and right click to remove them. You can adjust the floor
+level when you need to put meshes at specific heights.
+
+.. image:: /img/gridmap.png
+
+As mentioned above, you can also define new CollisionShapes at this
+stage by doing the following steps:
+
+.. image:: /img/load_collisionshape.png
+
+There you are!
+
+Reminder
+--------
+
+-  Be cautious before scaling meshes if you are not using uniform
+   meshes.
+-  There are many ways to make use of gridmaps, be creative!