User Tools

Site Tools


tutorials:community:sausage:inkscape_to_orx

Using the Inkscape SVG to ORX Converter

Purpose

This tool allows the user to design meshes for use on Object Body Parts in the form of VertexLists. Box and Sphere type body parts are very straight forward and automatic. Mesh parts however, need some kind of editor to make the job easier.

Inkscape is an excellent tool for creating paths on top of your texture. This tool then allows taking the native Inkscape SVG and converting the paths into config format for Orx.

How to work with Inkscape and Convert

In order to create SVG paths in Inkscape and use these as mesh VertexLists in orx. You can download the converter here. Follow these steps…

1. Open Inkscape

2. Select File > Import to bring in a graphic that you want to create path(s) for.

From Inkscape 0.91 onwards, be careful to choose the right DPI for your image when importing. You'd think it best to try to use DPI “From File”, however in my trials, Using “Default import resolution” (which is likely 90 DPI) is the one to use to ensure the scaling of your meshes are correct.

3. Your graphic will appear on the design surface in Inkscape.

4. Right click your graphic and select Image Properties. You need to get the graphic into the top left hand corner. Enter 0 for both X and Y. The image will snap to the top left.

5. Then select the Object > Object Properties menu. We need to lock the object down to the surface.

6. Click the Lock checkbox. This way, the graphic cannot be accidentally clicked or moved while you work on your paths.

7. Zoom into your graphic to make it easy to work with.

8. Select the freehand lines tool.

9. Draw a triangle. It must be drawn in a clockwise direction. So in this example, you could start on the left hand point, go up and right for the second point, then straight down for the third. This is drawing in clockwise which is required by Box2D in orx. I suggest you select the Fill and Stroke properties to have a nice bright stroke, and semi transparent fill to make it easy to visualise your triangles, squares or polygons.

10. Draw more path shapes to build up a convex ramp out of several path shapes.

Very Important, all objects must be ungrouped in case they have special transforms on them. Please ungroup everything before saving. The converter will warn you if you don't.

11. And our final design is done. In this graphic, it will be using eight path shapes to make up the curve. Save the file somewhere as an Inkscape SVG.

12. If you didn't get the converter already, get it now from: http://orx-project.org/images/fbfiles/files/InkscapeToOrxMesh03.zip and load it up.

Please note the shots below are from the 0.1 version. 0.2b has more functionality but the same applies. Below will be updated in the future.

13. Browse to the SVG file and enter a Base Object Name. This name is used when outputting your orx config lines.

14. Click preview to see what your output will look like or Convert to make a real conversion. If the Clipboard radio button is selected, the converted information is copied to the clipboard, otherwise you;ll be prompted to save your output file as an .INI.

tutorials/community/sausage/inkscape_to_orx.txt · Last modified: 2017/09/04 10:30 (3 weeks ago) by sausage