Jump to content

DEM's and Borders the Easy Way


WrinkleysRule

Recommended Posts

  • Wrinkley

@Timsp

As bdbssb says once you have applied the modifiers in Object mode they should no longer appear in the side panel either in Edit or Object mode , the fact that the terrain goes flat once you return to the Edit mode  which  points to  a problem in applying the modifiers. I presume also the terrain returns when going bac k to Object mode.

Unfortunately I am still using Blender 2.79 version (until I can get outstanding projects completed ) so I can't test the tutorial in Blender version 2.8 /2.9 at the moment.

Link to comment
Share on other sites

Dear all,

Maybe you have some scaling tips for me on using a Blender model to import in GE. I noticed it with the borders and now a custom road I made when importing into GE. I aligned the imported "Border mesh" to the map "terrain"  and use the same heightmap basis for both, of course cropped different as in the tutorial due to scale.

I then aligned the border to the map  from Blender into GE where X and Z share the same scale up as model is imported very tiny into GE, like at 0.000003  scale.
When then making the roads I exported the "terrain" data first from GE, imported that as object in Blender to ensure fit and made the road with a schrinkwrap to the GE imported generated terrein. Then export the roadmesh from Blender to id3 and import into GE to see how it fits.
 I see the X and Z scaleup is the same , however the height scale Y seems to not fit and requires many tweaking, what i dont get as i used GE terrain in Blender.

Are my thoughts are correct that when I shrinkwrap the road to the GE imported terrain in Blender,  it should match in both Blender and GE right at the same X,Y,Z scaleup? Or is scaling always a matter of tweaking in GE? 

example aligned.JPG

example aligned road wrong.JPG

Link to comment
Share on other sites

  • Wrinkley

@Timsp

One important point to note is the export setting in GE --File --Preferences--General--Save and Export as Wavefront OBJ --Scale must be set to 1 every time you update GE (current version 8.2.2 posted 16.11.2020 available here https://gdn.giants-software.com/downloads.php)

Remember the plane you created for your border in the tutorial was 2m x 2m so scaling up would be required (as mentioned in the tutorial)

Final border scaling,  as you have imported your complete terrain into Blender you can import your border into Blender as well  and  scale your border to the correct size, and always Ctrl A set rotation and scale before exporting to i3d

There is always going to be a difference especially in the Z (Y) scale between Blender and GE because of the different way the terrain is transformed/created.

 

Road Implementation.

The way I do roads is by using the Set Terrain by Height script to flatten the road path first so you have the terrain at the correct level.

There are two methods I use for creating the road system one is the shrinkwrap method you describe  and I haven't had the problem you are describing, though I see from your image you have scaled the road by 5 in all axis.

The other method I use but is a bit more involved  is to convert the spline I used to set the terrain height to a CSV format and import that into Blender and create the road using the curve and array  modifiers

Example from FS17 using Blender 2.79

Terrain adjusted using the mHeightR = mHeight + i/smooth and mHeightL = mHeight - i/smooth settings of the script

ydKNnAQ.png

Note: In the above picture there are two splines, the one marked Original spline is a 2d spline created by just following the road layout on a Google Earth Overlay the second is a 3d spline created from the original spline with more points spaced evenly along the spline for better definition/fit.

Spline Converted to CSV

qKzwbwp.png%20

 

Road Created in Blender

a0yNigb.png

 

Final Result

Rw0uEwQ.png

 

Link to comment
Share on other sites

Dear Wrinkley,

Thanks again for the response and pictures! I indeed did not set it to 1 in GE so that helps. 
Further on the roads to set terrein by height script is a great proposal to try out, helps me alot.

For sure will play around with these tips this weekend and really appreciate your feedback!

Tim

Link to comment
Share on other sites

  • Wrinkley

@Timsp

You will find the other scripts in the  Set Terrain Height/Placement tutorials  a great time saver as well, but a word of warning on the Set Terrain Height script, it cannot be undone  so always do a backup first (simple way is to make a copy of your map Dem image).

It is always better to experiment with different ways of doing things (on a blank map) and when you find one that works for you, use it and try and improve on it

Link to comment
Share on other sites

17 minutes ago, WrinkleysRule said:

@Timsp

You will find the other scripts in the  Set Terrain Height/Placement tutorials  a great time saver as well, but a word of warning on the Set Terrain Height script, it cannot be undone  so always do a backup first (simple way is to make a copy of your map Dem image).

It is always better to experiment with different ways of doing things (on a blank map) and when you find one that works for you, use it and try and improve on it

@WrinkleysRule huge thanks for the detailed help. 

Link to comment
Share on other sites

  • Wrinkley

@bdbssb

No problem, will probaly do an  updated Tutorial (have one I done on FS.UK two years ago) on various ways of doing roads at a later date also a quick little update to the Spline Placement script soon just making the random scaling more usable (same random scale on all axis) to avoid squashed and deformed trees items etc.

  • Like 1
Link to comment
Share on other sites

  • 2 months later...

Sadly I found this thread after I'd already sorted my DEM using someone else's tutorial and so I haven't got the stuff for borders and will probably have to wing it.

 

I am however trying to use your technique of bringing the field edges and roads into the GE with the weights files. I've traced the fields in paint.net in white and saved it as the sand weight png with the rest of the file black obviously, but nothing shows in GE. I can see on the asphalt weight files the roads I had painted within the GE myself and nothing looks different particularly between the two files (obviously the shapes are different!). Is there a line thickness issue maybe? Or I've used the wrong white and should have used a grey?

Link to comment
Share on other sites

  • Wrinkley

First off would I be right in assuming the dem is of a rather flat area of GB.

Make sure ALL your current weight .png's are blank (all Black)

There is a problem when using paint net to do the weight files, paint net saves the file as an index colour not in a greyscale or rgb format so has to be changed to greyscale in Gimp or Photoshop.

I hope you are not physically tracing the outlines of the fields/roads etc

The way I do the relevant weight files is to open the GE pic in paint.net then use  Effects --Artistic-- Ink Sketdh  (or linoCut) and adjust the sliders to give the best results, then save the file as a png and reopen in photoshop (or Gimp) and resave as the relevant weight file.

 

This is a link to a free legacy edition of PhotoShop (CS2) that I use and find it more than adequate for editing all the textures in FS19 (with the Nvidia dds plugin )

https://www.techspot.com/downloads/3689-adobe-photoshop-cs2.html

and a another link for Gimp.

https://www.gimp.org/downloads/

Depending on how far you have got into your map creation it may be worthwhile redoing the DEM using this tutorial if you want a realistic border

Any indepth problems with the tutorial or advice with Dem or using the splines/placements scripts just pm me

Link to comment
Share on other sites

Thanks. The issue was  twofold, I'd inadvertently been creating the weight files as 2049x2049 because I was using the sat map png as the base, and the second was the 8 bit single channel one due to paint.net not saving in the correct format. I've sorted both those in Gimp and it's working fine, I'm pissed with myself because I should have spent a whole lot less time faffing on that and read the bloody GE console as the error was clearly stated in there. Lesson learned.

 

I'm now looking at the roads, and have had some initial success using street spline constructor on a relatively straight road but am now running into problems with some of the more twisty and convoluted roads, it either doesn't create the file complaining about angles too great, OR, it creates the road and there is a ruddy great 180 degree corkscrew part of the way down. I can't quite get my head around why GE changes the X and Z rotations of an object when I rotate purely around the Y axis, it flips from 0 to 180 or -180 and that's what's causing the issues, but I'm damned if I can figure out how.

Link to comment
Share on other sites

  • Wrinkley

Sorry I can't help you with the Spline street constructor as I have never used it, I create roads either by importing the whole terrain into belnder and working on it there or use  a spline exported in GE (seperate spline script ) as a csv file (csv importer only works in blender 2.79) and imported into blender converted to a curve then use the array modifier to create the road.

For country lanes I just use the paint terrain by spline script, another method I've seen used is using the spline placement script , with this you create your spline in GE then for the placed object you Create-Primitive -plane and export the resultant placed objects as an obj file into blender (set plane size to final road section size) to work on.

The GE rotation always cause problems which I believe may be due to the conversion to radians for the game.

I also find it useful to move the console window to another part of the screen  (or seperate monitor if available)

Link to comment
Share on other sites

Thanks, I'm not familiar at all with Blender so I'd rather not go down that rabbit hole unless absolutely necessary. I've managed to resolve the issues I was having with SSC by manually changing the gizmo provided rotations, with hand typed ones. Laborious, annoying, but it seems to have worked. Now I need to figure out how to do proper junction markings but I feel like I'm making some significant progress quickly. The end product is never going to be as good as people who know what they're doing but we have to start somewhere.

I'm planning on looking at your spline placement scripts next to populate the road edges with trees and hedges.

Link to comment
Share on other sites

  • Wrinkley

Sooner or later you are going to want to change or make some items to suit your maps so you will need to get into  3d modelling and Blender is free with loads of tutorials available. (Horsey wind pump maybe)

Before using any of the scripts I recommend you practise on a blank map to see just what can be achieved as some changes can't be readily undone, especially terrain height,

With the paint terrain script  to get the relevant numbers for the textures I suggest you open the map i3d  in notepad and copy all the <Layer name= and <CombinedLayer name= entrys in one go and paste them into a new notepad file, this will give you a numerical list of all the textures to use in the script, remember of course to minus 1 each time as textures start from 0.

Link to comment
Share on other sites

  • 3 weeks later...

I've got my SRTM in Microdem, have made the zRange adjustment, changed from color to grayscale. But that's where I run aground. 

File>Save DEM/Grid > Geotiff  -- When I drag the file into Google Earth it is just a dumb overlay file. As soon as I move anything on the map, it just floats out of place.

Ideally I would use the Quick to Google Earth and let the 2 programs handle the intermediate details, but I do not know where to find that option. I don't see EXPORT anywhere under FILE or any other menu. Help?

Link to comment
Share on other sites

  • Wrinkley

Usually with the new versions o f microdem you either slect the GooglEarth globe in the toolbar or right click on the map and select Export where you are given a choice between quick and deliberate  export to Google Earth, however there seems to be a bug in the programme now that doesn't allow adjustment of opacity in Google Earth so you are left with a partially visible srtm and another bug, as you have found, id that it no longer saves as aGeoTiff  but as  a .tif image.

The only soloution I can suggest at the moment is to find an earlier version of the Microdem programme which appear to work as normal or use QGIS (free  full blown geospatial programme)

  • Thanks 1
Link to comment
Share on other sites

  • 2 weeks later...
On 2/7/2021 at 4:24 AM, WrinkleysRule said:

Sorry I can't help you with the Spline street constructor as I have never used it, I create roads either by importing the whole terrain into belnder and working on it there or use  a spline exported in GE (seperate spline script ) as a csv file (csv importer only works in blender 2.79) and imported into blender converted to a curve then use the array modifier to create the road.

Is there a post that explains HOW to import the whole terrain into blender? That sounds intriguing 

Link to comment
Share on other sites

  • Wrinkley

No single post , but all you do is open your map in GE and zoom back until the whole map is in view (if you want to import the whole map into Blender) select the terrain in the sceneograph and select  Edit - Export selection and save as .obj it will take a while as there is apoly count of approx  216664 for a 2k map some computers cannot handle such a large blender file.

If you just want to import part of the map then zoom out until the part you want is in  view and do the same as above.

Basically when exporting terrai fron GE to Blender what you see in GE is what you will get in Blender.

To avoid any complication always ensure you are looking directly down on your map in GE before exporting.

I don't believe it is possible to re-import terrain from blender as an i3d and use it instead of the  ingame terrain.

  • Like 1
Link to comment
Share on other sites

  • 4 months later...
  • Wrinkley

Just tried both,

https://www.usna.edu/Users/oceano/pguth/website/microdem/microdem.htm

and


https://www.usna.edu/Users/oceano/pguth/md_help/html/download_md.htm

 

downloaded setup.exe with no problem

If you need to use another programme I suggest QGIS (free at https://www.qgis.org/en/site/  ) but be warned it is a fully fledged Geospatial programm so will require a bit of familarisation.
 

Link to comment
Share on other sites

  • 2 months later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now