My Hometown Walkthrough
Still in the planning stage.
I have managed to build up a 3D terrain of the area by converting Google Earth info into a heightmap, which I then read into FreeWorld3d (a terrain modeller) to produce the 3D mesh.
I have managed to build up a 3D terrain of the area by converting Google Earth info into a heightmap, which I then read into FreeWorld3d (a terrain modeller) to produce the 3D mesh.
23/05/2011
Better late than never! So for this year I will be spending a great deal of my time on this project. The following pics show what I already have, and will be the basic backbone for further development.
Pic1 : Google Earth view of Knynsna Lagoon and surrounds.
Pic2 : After conversion to a heightmap
Pic3 : After conversion to 3D and addition of a water plane
Pic4 : Untextured 3D view
Pic5 : Textured 3D view with no waterplane
Pic6 : The 2048x2048 texturemap used
This project is going to give me the opportunity to try out a range of different procedures. I've got high ground, low ground, calm lagoon water, rough sea water, beaches, and much more. The first problem is that it is only possible to get a very low detail mesh (at normal ground level) using heightmaps derived from Google Earth, but if I tackle small areas at a time, I'm sure I'll find a workaround.
02/06/2014
A new beginning:
I've always wanted to attempt a walkthrough of the key hotspots in my hometown of Knysna, South Africa.
The Knysna area comprises a terrain of approx 4 x 4 kms, so fairly large for a 3d map to run at a reasonable framerate.
I'm a bit of a terrain noob, so what better way to learn than jump in at the deep end and sink or swim?
So, hopefully, other terrain noobs will also learn from my struggles.
Well, firstly, I had to come up with a decent accurate terrain map.
This obviously had to be derived from global satellite data (otherwise known as SRTM data)
To process this data I used three free apps ( MicroDem, VTBuilder, and CryEngine3.5 Free SDK) and one not-so-free L3DT Pro
I always make notes as I go along (helps a few months later when one tries to remember what one did), so I'll just reproduce them here for those who might be interested in compiling their own part of our world.
How to obtain SRTM3 terrain height data for anywhere in the world:
1. Go to http://www.webgis.com/srtm3.html
2. Follow the instructions just beneath the world map.
3. This gives you a webpage of zipped .HGT files for the region selected
4. The name of each file gives the world location according to degrees latitude and longitude (e.g. S34E018 translates to 34deg South, 18deg East)
5. Download each file that you require.(Use ‘VTBuilder’ to assemble them)
6. Run the app ‘MicroDem’
7. Select ‘File/Open/Open and merge DEMs’ to merge the above selected .HGT files into one DEM
8. Use the ‘Subset and zoom’ button to get the area required.
I've always wanted to attempt a walkthrough of the key hotspots in my hometown of Knysna, South Africa.
The Knysna area comprises a terrain of approx 4 x 4 kms, so fairly large for a 3d map to run at a reasonable framerate.
I'm a bit of a terrain noob, so what better way to learn than jump in at the deep end and sink or swim?
So, hopefully, other terrain noobs will also learn from my struggles.
Well, firstly, I had to come up with a decent accurate terrain map.
This obviously had to be derived from global satellite data (otherwise known as SRTM data)
To process this data I used three free apps ( MicroDem, VTBuilder, and CryEngine3.5 Free SDK) and one not-so-free L3DT Pro
I always make notes as I go along (helps a few months later when one tries to remember what one did), so I'll just reproduce them here for those who might be interested in compiling their own part of our world.
How to obtain SRTM3 terrain height data for anywhere in the world:
1. Go to http://www.webgis.com/srtm3.html
2. Follow the instructions just beneath the world map.
3. This gives you a webpage of zipped .HGT files for the region selected
4. The name of each file gives the world location according to degrees latitude and longitude (e.g. S34E018 translates to 34deg South, 18deg East)
5. Download each file that you require.(Use ‘VTBuilder’ to assemble them)
6. Run the app ‘MicroDem’
7. Select ‘File/Open/Open and merge DEMs’ to merge the above selected .HGT files into one DEM
8. Use the ‘Subset and zoom’ button to get the area required.
9. Use ‘File/Save DEM’ to save this area as a DEM.
10. Use ‘File/Save image’ to save as a .BMP (saves it as a grey RGB image)
11. Load this .BMP file into ‘Paintshop Pro’
12. ‘Paintshop Pro’ loads this as a 8 bit/channel RGB image
13. Change it to a 16 bit/channel RGB image using ‘Image/Increase Color Depth’ then selecting ‘RGB-16 bits/channel'
14. Use ‘Image/Resize’ to increase the image size to a ‘power of two’ size (e.g 2048x2048)
15. Save this image as a .BMP
16. Finally, power up ‘L3DT Pro’
17. Select ‘File/Import/Heightfield’ and choose the above .BMP file
10. Use ‘File/Save image’ to save as a .BMP (saves it as a grey RGB image)
11. Load this .BMP file into ‘Paintshop Pro’
12. ‘Paintshop Pro’ loads this as a 8 bit/channel RGB image
13. Change it to a 16 bit/channel RGB image using ‘Image/Increase Color Depth’ then selecting ‘RGB-16 bits/channel'
14. Use ‘Image/Resize’ to increase the image size to a ‘power of two’ size (e.g 2048x2048)
15. Save this image as a .BMP
16. Finally, power up ‘L3DT Pro’
17. Select ‘File/Import/Heightfield’ and choose the above .BMP file
18. Click ‘Next’
19. Adjust the ‘Horizontal scale’ to your desired size (i.e. if your image is 2048x2048, then a value of 2m/pixel will make your final map 4096m x 4096m)
20. In the same dialog window set your ‘min altitude’ and ‘max altitude’ according to the terrain you are working with.
21. If you have water in the area then it is necessary to clip the map to a negative
Minimum value using ‘Operations/Heightfield/Clip heightfield’
22. Finally, ‘File/Export/Export active map layer’ as a .RAW file for use of ‘CRYEngine’
23. Import into ‘CRYEngine’, smooth the terrain and adjust Ocean height.
24. Export as a .RAW heightfield.
CryEngine has a marvellous terrain editor and can produce massive detailed terrains which run at a fair lick. Here is my Knysna map a-la-CryEngine:
19. Adjust the ‘Horizontal scale’ to your desired size (i.e. if your image is 2048x2048, then a value of 2m/pixel will make your final map 4096m x 4096m)
20. In the same dialog window set your ‘min altitude’ and ‘max altitude’ according to the terrain you are working with.
21. If you have water in the area then it is necessary to clip the map to a negative
Minimum value using ‘Operations/Heightfield/Clip heightfield’
22. Finally, ‘File/Export/Export active map layer’ as a .RAW file for use of ‘CRYEngine’
23. Import into ‘CRYEngine’, smooth the terrain and adjust Ocean height.
24. Export as a .RAW heightfield.
CryEngine has a marvellous terrain editor and can produce massive detailed terrains which run at a fair lick. Here is my Knysna map a-la-CryEngine:
To progress further with my project, using CryEngine, meant that I had to learn a whole lot of new stuff.
I was unsure whether I wanted to do this, when I had on hand a perfectly good engine (Oddity 2) with which I was entirely familiar.
The size of my terrain mesh was 2048 x 2048 vertices, way over the Oddity limit of 32768 vertices...so the question I had to ask myself was "how could I get this mesh into Oddity?"
The answer presented itself when reading through the L3DT Pro user manual.
One can export a tiled and textured version of one's mesh... and this is what I did.
I exported 8x8 (i.e. 64) textured tiles which I then imported into 3dsMax ( a few mirroring problems along the way), and then exported as .X files for subsequent .md5mesh conversion and import to Oddity2.
For those interested, here are my notes on the steps I went through for this process
Using L3DT to create a 8x8 tiled Knysna terrain mesh for export to 3DSMax
1. Using L3DT, create a texture map from your imported heightfield
2. Use ‘File/Export/Export optimised mesh’….
3. Choose the Collada DAE format for your output files, give a file name and click ‘Save’
4. In the ‘Export mesh’ dialog that comes up, set ‘Max error’ = 1, tick ‘Split map into tiles’, set ‘Tile size’=256 (this gives 8x8 = 64 tiles)
5. Tick ‘Texture coordinates and materials’ and tick ‘Resize images to nearest power-of-two’
6. If importing into 3DSMax then choose the options ‘Axes’ = ‘XY plane,Zup’ and ‘Face winding’=’CCW (OpenGL)’
7. Tick ‘Origin at centre’
8. Click ‘Ok’ and wait until the .DAE mesh tiles and .DDS texture tiles are all output to your chosen folder.
Using 3DSMax to import the above tiles and export them as .X files
1. Ensure that you have the ‘openCOLLADA’ and ‘Panda DirectX Exporter’ plugins installed in 3DSMax.
2. Ensure your 3DSMax unit settings are Metric and in metres
3. For each tile, import its .DAE mesh using the ‘openCOLLADA’ option
4. The tile will be orientated vertically in 3DSMax’s XZ plane, but don’t worry as this is required for correct export via the Panda DirectX exporter with the ‘X File Settings’ tab having ‘Text’, ‘Sub frame hierarchy’ and ‘Left Handed Axis’ checked.
5. If you wish to show each tile’s texture orientated correctly on the tile mesh, then do the following:
6. Add the ‘Unwrap UVW’ modifier to the tile editable mesh/poly, open the UV Editor, select all the vertices, and choose Mirror around the X axis.
So here is what I have currently ended up with in Oddity 2 (no detail at this stage...just plain grass, rock, sand and a flat textured 'water' plane). Being composed of seperate mesh tiles, the mesh size is no longer a problem and only those tiles in camera view are rendered, which helps the framerate a great deal.