How to create models with Blender that will work in RST.
Blender is a 3D tool that can be used to create and edit models for RST. This guide will hopefully help you around the peculiarities of Blender that I encountered when creating RST models.
The Blender interface
- To move the view around, click and drag with the middle mouse button to rotate, and hold shift while doing this to pan. To zoom, use the scroll wheel. If you're using a laptop or a computer without a middle mouse button/wheel, there are alternatives key combinations that can be found online.
- To select objects, click with the right mouse button. In 'object mode' (the default mode), selected objects have a pink border. In 'edit mode' (used for editing vertices), pink means not selected, and yellow means selected (confusing, I know.)
- To de-select everything, you can press 'a' twice (once selects, twice de-selects).
- To select specific objects, you can press 'b' and drag a bounding box around the objects you want to select.
- To translate a selected object, press 'g'. To move it on the X axis only, press 'g' then press 'x'. This useful trick works for all axes (x,y,z.)
- To rotate a selected object, press 'r'. To rotate it about the X axis only, press 'r' then press 'x'.
- To scale a selected object, press 's'.
- At the bottom you will see a bunch of buttons, but you only need to be concerned with one: the materials section. Make sure the grey sphere is pressed in the first row of icons, and the red sphere is pressed in the second (more on this later.)
When you first open Blender, you should see a cube in the center of the screen. Press 'x', then 'enter' to delete this cube. Then go to file->import->3D Studio (.3ds) to select the model you would like to import. Once you click "Import", Blender will pop up a box with some additional import options. Make sure "Transform Fix" is NOT selected, and click Ok. For this guide, I will import the minibear.3ds model found in the directory: RST/scene/polarbear.
If you right click on the head of the bear, you will notice it turns pink. The polarbear is actually two objects (the body, and the head) in one model.
If you are importing models from the internet, or creating your own, RST requires that all models have a material. Materials are similar to "colors" and contain other settings such as specularity, etc. If you find RST seg faulting when you load your model, a likely reason is that some object does not have an associated material. When you select the body of the bear, you should see that it has a material associated with it, and you may change the RGB sliders in the materials section to alter the color. In the image below, you can see how to add a material if your object does not have one (this is unnecessary for the bear.)
Putting models together
3D modeling is beyond the scope of this document, but it may not be necessary. Using just the tools here, you can import multiple models (as objects) and put them together into one large model in Blender (many are available for free online). In the image below, I have added some British refinement to the bear. Notice that the top hat is selected and the corresponding material (black) shows up in the materials section.
Each part of an arm must be a complete model in RST. To make the bear walk you would need to cut off the legs and export just the body, then export each leg individually.
Making RST-compatible models
RST does not appear to support textures or transparency (alpha), but leaving them in the model doesn't seem to crash RST.
RST allegedly does not support 'quads' and requires all faces to be triangles. I was able to use quads just fine, but if RST is seg faulting, you may need to convert your faces to triangles:
- select the object by right clicking on it
- press 'tab' to enter 'edit mode'
- press 'a' to select everything
- press the spacebar, then go to edit, faces, and click convert to triangles
- press 'tab' to exit 'edit mode' and return to 'object mode' (very important)
The image below shows this process:
Exporting is similar to importing, but can be a little tricky. Press 'a' twice (or three times) to make sure everything is deselected (no objects should be pink), then use the 'b' key to drag a box around the objects you want to export. Though this may seem simple, you want to make sure everything is selected that you want to export, but nothing else (for instance, the light in the bottom left of the image below should NOT be selected.) Then, go to file->export->3D Studio (.3ds) and save your model! The image below shows the selection process, notice how the bear body, bear head, top hat, and monocle are all selected.
Using your model in RST
Once you have saved your model, simply modify the rscene files (or create your own .rscene for the scene and .rsdh for the a robot.) In my example, I modified the file "DESKTOP-ARM-WITH-HAND.rscene" so that the 8th object corresponded to my classy polarbear:
##### OBJECT 6 ##### > OBJECT BEAR2 polarbear/polarbearhat.3ds > POSITION 0.673 -1.082 0 > ORIENTATION 0 30 30
And you can see the results within RST:
When exporting a portion of an arm, the center of translation and rotation (in RST) will be at 0,0,0 (in Blender.) If you notice sections of an arm rotating around the wrong place, or translated incorrectly within RST, you may check to make sure the model is correctly translated relative to 0,0,0 in Blender. If your model is displaced vertically in RST, import it in blender and press 'g' (to translate), then 'z' (to translate along the z axis only), then move the model down by moving the mouse. Right click to exit the translate mode, then export your model and see if the problem was corrected.