Posts: 1,057
Threads: 155
Joined: Jan 2012
Re: 3DWin and Wavefront Obj
2013-10-19, 16:56
Here's the workflow I used to get to the final state by the way.
FOR NON-STEPPED TERRAIN:
1. Open "worldmachine_project.tmd" in World Machine.
2. Tweak the heightfield if you want. Then export from World Machine as "worldmachine_output.obj".
3. Open "worldmachine_output.obj" in MeshLab.
4. In MeshLab select "Filters" > "Normals, Curvatures and Orientation" > "Transform: Move, Translate, Center". Check the "translate center of bbox to the origin" box and click "Apply" then "Close".
5. In MeshLab select "Filters" > "Normals, Curvatures and Orientation" > "Transform: Rotate". Set the Rotation angle to 270 and click "Apply" then "Close".
6. In MeshLab select "Filters" > "Normals, Curvatures and Orientation" > "Transform: Scale". Uncheck the "Uniform Scaling" box. Then set the X Axis value to 40960, the Y Axis value to 15360, and the Z Axis value to 40960. Click "Apply" then "Close". This dialog is a bit buggy so you will have trouble entering the scaling values.
7. In MeshLab select "File" > "Export Mesh As...". Export the file as "meshlab_output_nosteps.stl".
8. Using the command prompt or a batch file convert the STL file to LDR using "stl2dat.exe". An example of the command line looks like this:
stl2dat meshlab_output_nosteps.stl -ldr -raw
9. Open the model in MLCAD. The model may be upside-down, so rotate 180 degrees around the x-axis if needed.
10. You're basically done. You can do any post-processing you want in LETGUI, such as adding conditional lines using Edger2 or converting triangles to rectangles using rectifier.
FOR STEPPED TERRAIN:
1. Open "worldmachine_project.tmd" in World Machine.
2. Tweak the heightfield if you want. Then export from World Machine as "worldmachine_output.obj".
3. Open "worldmachine_output.obj" in MeshLab.
4. In MeshLab select "Filters" > "Normals, Curvatures and Orientation" > "Transform: Move, Translate, Center". Check the "translate center of bbox to the origin" box and click "Apply" then "Close".
5. In MeshLab select "Filters" > "Normals, Curvatures and Orientation" > "Transform: Rotate". Set the Rotation angle to 270 and click "Apply" then "Close".
6. In MeshLab select "Filters" > "Normals, Curvatures and Orientation" > "Transform: Scale". Uncheck the "Uniform Scaling" box. Then set the X Axis value to 40960, the Y Axis value to 640, and the Z Axis value to 40960. Click "Apply" then "Close". This dialog is a bit buggy so you will have trouble entering the scaling values.
7. In MeshLab select "File" > "Export Mesh As...". Export the file as "meshlab_output_stepped.stl".
8. Using the command prompt or a batch file convert the STL file to LDR using "stl2dat.exe". An example of the command line looks like this:
stl2dat meshlab_output_stepped.stl -ldr -raw
9. Open the LDR file in LDDP.
10. Change decimal accuracy to 0 by going to "Tools" > "Options" > "Configuration Values" tab > "Editor Behavior" subtab and setting "Position Decimal Accuracy" to zero. Then select all (ctrl A) and round everything (ctrl D).
11. Save the LDR file in LDDP.
12. Convert the LDR file to Wavefront OBJ using 3DWin. Export as "3DWin_output.obj".
......3DWin rotates the model again!!!! Stop using 3DWin!!!!......
13. Open "3DWin_output.obj" in MeshLab.
14. In MeshLab rotate the model again if needed because 3DWin changes the rotation when exporting for some reason. Then scale the height by 24 along the y-axis.
15. In MeshLab select "File" > "Export Mesh As...". Export the file as "meshlab_output_stepped.stl".
16. Using the command prompt or a batch file convert the STL file to LDR using "stl2dat.exe". An example of the command line looks like this:
stl2dat meshlab_output_stepped.stl -ldr -raw
17. Open the LDR model in MLCAD. The model may be upside-down, so rotate 180 degrees around the x-axis if needed.
18. You're basically done. You can do any post-processing you want in LETGUI, such as adding conditional lines using Edger2 or converting triangles to rectangles using rectifier.