using_multi_mesh_instance.rst 3.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. .. _doc_using_multi_mesh_instance:
  2. Using multiMeshInstance
  3. ------------------------
  4. Introduction
  5. ~~~~~~~~~~~~~~~~
  6. In normal scenario, you would use a :ref:`meshInstance <class_MeshInstance>` node to display a 3D mesh. For example, a human model as the main character. In some cases, you would like to create multiple instances, you could duplicate the same node for multiple times and adjust the transforms manually. This may be a tedious process and the result may look mechanical. Also, this method is not favourable to rapid iterations. :ref:`MultiMeshInstance <class_MultiMeshInstance>` is one of the possible solutions to the problem.
  7. MultiMeshInstance as the name suggests, create multiple copies of the meshInstance over a surface of a specific mesh. An example would be having a tree mesh populate a landscape in random scale and orientation.
  8. Setting up the nodes
  9. ~~~~~~~~~~~~~~~~~~~~~~
  10. The basic set up requires three nodes. Firstly, the multiMeshInstance node. Then, two meshInstance nodes.
  11. One node is used as the target, the mesh that you want to place multiple meshes on. In the tree case, this is the landscape.
  12. Another node is used as the source, the mesh that you want to have multiple duplications. In the tree case, this is the tree.
  13. In our example, we would use a :ref:`Node <class_Node>` node as the root node of the scene. Your scene tree would look like this:
  14. .. image:: img/multimesh_scene_tree.png
  15. .. note:: For simplification purpose, this tutorial would use built-in primitives.
  16. Now you have everything ready for mesh duplications. Select the multiMeshInstance node and look at the toolbar, you should see an extra button called ``MultiMesh`` next to ``View``. Click it and select populate surface in the dropdown menu. A new window titled Populate MultiMesh will popup.
  17. .. image:: img/multimesh_toolbar.png
  18. .. image:: img/multimesh_settings.png
  19. MultiMesh Settings
  20. ~~~~~~~~~~~~~~~~~~~~~~~
  21. Below are the descriptions about the options.
  22. Target Surface
  23. +++++++++++++++
  24. The mesh you would be using as the surface for placing copies of you source mesh.
  25. Source Mesh
  26. +++++++++++++++
  27. The mesh you would be duplicating on the target surface.
  28. Mesh Up Axis
  29. +++++++++++++++
  30. The axis used as the up axis of the source mesh.
  31. Random Rotation
  32. +++++++++++++++++
  33. Randomizing the rotation around the mesh up axis of the source mesh.
  34. Random Tilt
  35. +++++++++++++++++++
  36. Randomizing the overall rotation of the source mesh.
  37. Random Scale
  38. ++++++++++++++++++
  39. Randomizing the scale of the source mesh.
  40. Scale
  41. ++++++++++++++++++
  42. The scale of the source mesh that will be placed over the target surface.
  43. Amount
  44. +++++++++++++++++++
  45. The amount of mesh instances placed over the target surface.
  46. Select the target surface, in the tree case, this should be the landscape node. And the source mesh should be the tree node. Adjust the other parameters according to your preference. Press ``populate`` and multiple copies of the source mesh will be placing over the target mesh. If you are satisfied with the result, you can delete the mesh instance used as the source mesh.
  47. The end result should look like this:
  48. .. image:: img/multimesh_result.png
  49. To change the result, repeat the same step with different parameters.