[WIP] Tor Radom LIDAR

Discussion in 'Locations' started by Bienio, Jul 15, 2014.

  1. Bienio

    Bienio Registered

    Joined:
    Nov 18, 2013
    Messages:
    13
    Likes Received:
    0
    It's going to be a long post, but I hope you will manage to read all of it (there's pictures too!!! ;) ) BTW, how do you insert an image so it's visible, not just a link?

    Hello, I am a student at Warsaw University of Technology and I'm currently writing a master's thesis about the use of photogrammetry in creating 3D models of race tracks. It's a combination of my major - photogrammetry, and hobby - simracing.

    I have high quality aerial data for the area of a karting track - Tor Radom in Radom, Poland. I’ve got a 10cm GSD (Ground Sampling Distance, terrain pixel size) orthophoto (rectified aerial image) and ALS (Airborne Laser Scanning) point cloud with resolution of 12 points/m2. In my master's thesis I have two main objectives: to check the accuracy of this aerial data and then actually create a 3D model of a race track and import it into rFactor or rFactor 2. I have created this topic so you can track my progress and also, hopefully, so I could get some help from you, the modders, as I have basically no modding experience at all, unfortunately.

    View attachment 13600
    View attachment 13610
    View attachment 13606

    I have vistited the track to take some photos and take GPS RTK measurements. I’ve measured almost 100 points and used those as reference and checked the orthophoto’s and ALS’s accuracy. The results are really good and I’ll try to summarize it briefly.

    View attachment 13601
    View attachment 13611

    The orthophoto was usually off by only a couple of centimeters from GPS measurements, so the horizontal accuracy is even better than the 10cm GSD.

    ALS data consists of many channels, but the most important for me are point intensity and colour. Intensity channel tells you how much energy from the laser was reflected at that particular point, so basically it’s a greyscale 3D image of reality (of course you can use colours for visualisation purposes, but it’s artificially added, there’s only one data channel, let’s say a range 0-255, whereas in RGB you would have 3 channels with a range of 0-255). True RGB colour is added to those points from georeferenced aerial images that are usually taken during the same flight that the ALS scan was done. I have generated 2D raster images of intensity and colour point clouds with a GSD of 20cm and compared it to the reference GPS data. The results were pretty good for intensity. It was usually off by only a couple of centimeters horizontally and vertically. The RGB colours came out to be completely off, usually by about 30cm, so I am not going to use them in my thesis.

    The ALS data seems pretty accurate, but it’s got some ‘noise’ in it, as you can see in the cross-section of one of the corners (RTK in red vs ALS in yellow) and mesh visualisations below (track surf).

    Before filtering:
    View attachment 13603
    View attachment 13604

    To get rid of that noise on the tarmac I applied a smoothing filter. As you can see on the images it gives pretty good results. Vertically, the GPS measurements are translated vertically relative to the ALS data a couple of centimeters. It’s a systematic error and there could be a couple of different reasons why this happened (different geoid model for example), but what’s most important is relative accuracy - and that’s very good.

    After filtering:
    View attachment 13605
    View attachment 13602

    The problem with ALS data is its poor resolution, compared to orthophoto. Identification of track limits, curbs etc. is more difficult, as seen on the screenshots (left to right: ORTHO, COLOUR, INTENSITY). That’s why using orthophoto would be best for creating the horizontal track layout, and ALS data should be used to add Z values.

    View attachment 13607
    View attachment 13608

    That part of my thesis I could handle myself, but now comes the time to start creating the 3D model. I have basically no experience in 3ds max, I’ve only went through a couple of tutorials a few months ago and I’ve already forgotten everything. I’ll have to basically start learning all over again. If you have some tutorials that you would consider best for learning how to create a simple track please share.

    First problem is - should I create an rFactor or rFactor 2 track? Do you guys think making a track for rF1 is easier? If it is then I should probably start off with rF1. Please give me a tip here.

    Then when it comes to creating the track, I have a couple of ideas how to actually use the point cloud. I know Mario Morais wrote a 3dsmax plugin that can import point clouds (Spline track maker IIRC). But 3dsmax 2015 can import point clouds as well, so maybe there’s no point in using the plugin. I know that there are no rF plugins for 3dsmax 2015 version, but I should be able to create the geometry based on the point cloud in 2015 and then import it to 2012 or older and proceed with creating the track, right?

    I don’t know how Z values are added to spline vertices in Mario Morais’s plugin, maybe he can clear that out if he reads this. But I’ve got two ideas how to use point cloud for adding vertical information. Simple solution - snapping vertices to point cloud (easy to do in 2015, you can turn on snapping to point cloud), and harder - interpolating height from nearest points.

    The simple method is self explanatory, you would just draw the spline on the point cloud, because 3dsmax 2015 let’s you snap vertices to the point cloud. But it wouldn’t be very accurate, since let’s say the white line is 20cm wide and the points from ALS could be even 30cm apart. You wouldn’t be able to draw the spline inbetween the points and the vertices would have to be exactly where the points from ALS data are.

    The second method is harder and I don’t know how to implement it in 3ds max, maybe writing a script is needed. My idea is to draw the splines on the orthophoto, which is very accurate horizontally. You would end up with a track mesh on a 2D plane. Then, you would add Z values to each vertex individually. Let’s say you find 3 closest ALS points (based on XY coordinates) and interpolate the Z value for a vertex from those 3 points (bilinear interpolation should be enough; creating triangle mesh from the point cloud and then applying the height from mesh to the track vertices for a given XY would be exactly the same thing, but I don’t know if you can do that in 3ds?). I hope you guys know what I mean, maybe I can describe it better. Or explain with a drawing or something ;)

    So, to summarize. I'm a newbie trying to create a small kart circuit using LIDAR aerial data and if you could give me tips on those topics I would be grateful:
    - would creating a track for rF1 or rF2 be easier?
    - any great tutorials for me to watch? I've seen some, but maybe you know some better ones?
    - what do you think about my ideas of using laser scan data for adding Z values?

    Also, feel free to ask any questions. Congratulations if you've read all of this ;)
     
    Last edited by a moderator: Jul 24, 2014
  2. hexagramme

    hexagramme Registered

    Joined:
    May 25, 2013
    Messages:
    4,245
    Likes Received:
    194
    Dude... You're awesome, hands down.
    I'm not a modder, but I love your idea. I really hope it materializes!

    You're in safe hands here. This community has some very talented track creators.
    I'm sure you'll get the help you need.
     
  3. Mario Morais

    Mario Morais Registered

    Joined:
    Oct 26, 2010
    Messages:
    1,465
    Likes Received:
    169
    The rFactor2 is better.
    1)- already supports karts 2)- Rfactor2 engine support high resolution surfaces (road). In rFactor2 is mandatory to have a minimum number of polygons in the road.

    Yes snapping vertices of spline to point cloud is my solution to Z values. I write a tool in C# to do that in maxscript is to slow.
    For XY i use images from Googlemaps but projected in XY plane.. i do it with my importGEO tool.
    In 3ds MAX 2010 use DirectX9 driver the maximum of image resolution is 1024x1024 so i get tiles from SASplanet tool.


    You can use a center spline and use loft to get road but i prefer my tool (http://www.mj-multimedia.net/soft/trackmaker/index.php)
     
  4. Bienio

    Bienio Registered

    Joined:
    Nov 18, 2013
    Messages:
    13
    Likes Received:
    0
    OK, then I guess I will go with rF2. I think there's less info available for modders, but some things are the same as in rF1. Such good quality data would be pretty much wasted in rF1 since you can't make a high-poly mesh of the track that would actually benefit from laser scan data's accuracy.

    EDIT: Also, I forgot to add, I made some photos of the curbs and then generated a dense 3D point cloud from those photos. I'm hoping to use this accurate model as a reference for creating curbs in 3ds max. I'll upload some pictures later.
     
    Last edited by a moderator: Jul 16, 2014
  5. Bienio

    Bienio Registered

    Joined:
    Nov 18, 2013
    Messages:
    13
    Likes Received:
    0
  6. Emery

    Emery Registered

    Joined:
    Oct 24, 2010
    Messages:
    3,035
    Likes Received:
    1,654
    The thumbnails are visible for me, so you're doing it right.

    In game, I suspect those curbs are too high-poly for good fps. Beautiful, though!
     
  7. Bienio

    Bienio Registered

    Joined:
    Nov 18, 2013
    Messages:
    13
    Likes Received:
    0
    Yes, of course, I will just use this hi-poly mesh as reference. It's probably possible to make a low-poly model look similar with some good textures and mapping, but I'm sure I won't be able to do it ;)
     
  8. WiZPER

    WiZPER Registered

    Joined:
    Oct 5, 2010
    Messages:
    1,517
    Likes Received:
    186
    Great project :D
     
  9. Bienio

    Bienio Registered

    Joined:
    Nov 18, 2013
    Messages:
    13
    Likes Received:
    0
    Just a small update on the progress, most of the time I was actually writing the theory part of the thesis, but I'm slowly beginning to work in 3ds.

    I managed to insert both the point cloud and the orthophoto, properly referenced into 3ds Max 2015. Here you can see the density of the point cloud compared to track width and a car.
    View attachment 13876

    And here you can see parts of the ortho and cloud as it is shown in 3ds.
    View attachment 13877

    I've got a couple of questions as well. Since I can easily use the point cloud as reference in 3ds 2015 I would like to use this version as long as I could. Do you think it would be OK to just work in 2015, apply some materials on the way just to see what the track looks like during the process of modeling, and then when the track is almost finished export it to 2012 to do all the work that is required to export the track into rf2 (apply different materials and do whatever else is needed). Or maybe should I try to export everything into 2012 as fast as I can?
     
  10. SPASKIS

    SPASKIS Registered

    Joined:
    Sep 7, 2011
    Messages:
    3,155
    Likes Received:
    1,426
    I am not a 3dsmax expert and I do not know what new features 2015 version contains wrt 2012 version.
    If it does not provide significant improvements I would stick to 2012 version asap just in case. You reduce uncertainties.
    However if it offers significant improvement the extra effort of downgrading everytime you need to export to rfactor 2 might compensate.

    I guess it is the same as for 2010 vs 2012. 2012 runs better than 2010. The import plugin only works with 2010. Some people only use 2010 for everything while others will use it only for import. I think that the main difference in your case is that you usually have to export many times while import is only required at yhe beginning of the process.
     
  11. Satangoss

    Satangoss Registered

    Joined:
    Jun 2, 2011
    Messages:
    1,123
    Likes Received:
    7
    rFactor 1 also allows "high resolution" tracks, it's up to the modder.
     
  12. Marek Lesniak

    Marek Lesniak Car Team Staff Member

    Joined:
    Oct 6, 2010
    Messages:
    1,585
    Likes Received:
    101
    The engine might not handle it. I'd stick to rf2.

    Greets from Poland :) Good luck with the project!
     
  13. Satangoss

    Satangoss Registered

    Joined:
    Jun 2, 2011
    Messages:
    1,123
    Likes Received:
    7
    It's just made out from your mind or do you have some scientific prove of it?

    There's LIDAR tracks for rF1 with hundreds of points per square meter and they work perfectly.


     
  14. Marek Lesniak

    Marek Lesniak Car Team Staff Member

    Joined:
    Oct 6, 2010
    Messages:
    1,585
    Likes Received:
    101
    Some time ago, I did tests with very high poly counts, can rF 1 handle it (how does it scale with performance) and at some point I had overall issues but I can't give you any numbers now, as I didn't take notes from those tests (it could be just a few milions of tris).
    On the other hand, I have a test track my friend did for me for rF 2 and we did similar tests (in that case, it was about making road as dense as possible, for better Real Road effects). I think, it was at about 20-30m tris, when he started getting issues in 3dsmax...rf 2, afair, was still fine at that point.
     
  15. Jka

    Jka Member Staff Member

    Joined:
    Jan 31, 2011
    Messages:
    954
    Likes Received:
    213
    Does 2015 have ability to save project in older version (like 2012 or 2011). If so, then its ok to work with 2015 until you are ready for first export. At least 2012 has this feature, but I'm not familiar any newer version of max.
     
  16. Bienio

    Bienio Registered

    Joined:
    Nov 18, 2013
    Messages:
    13
    Likes Received:
    0
    Yes, the 2015 can save in 2012 format, so I figured I'll use 2015 to make all or most of the geometry.

    I'm still learning 3ds Max (going through 3ds Max 2012 Bible by Kelly L. Murdock, page 372 out of almost 1600), so please excuse me if the answer to this question is obvious. I was wondering if it was possible to create a track surface using 2 splines for track limits as reference. Possibly a third center spline if it's needed, all on a plane, in 2D. Third dimension would be added from the point cloud later.

    Basically, I would like to achieve a similar effect to the one that Mario has got in his Spline Track Maker: https://www.youtube.com/watch?v=VTjwNu7o6as&list=UUPSBXCtpA0FcgDaXy2mNdzA&t=3m24s

    I tried using the free version of Trackmaker and making corrections manually, but this gives slightly uneven quads, as you can see on the screenshot below. So if there's a way to make it even easily that would be great. If it's impossible without the full version of Trackmaker I guess I will satisfy myself with a crooked mesh ;)
    View attachment 13911
     
  17. SPASKIS

    SPASKIS Registered

    Joined:
    Sep 7, 2011
    Messages:
    3,155
    Likes Received:
    1,426
    I dont think there is any problem with the mesh you show in the picture
     
  18. Bienio

    Bienio Registered

    Joined:
    Nov 18, 2013
    Messages:
    13
    Likes Received:
    0
    View attachment 13912
    I would like the edges of the mesh to follow the red lines. Those lines should be perfectly straight, perpendicular to the center spline and the distance between every 2 lines should be equal. The mesh I've got is pretty close, but not perfect, it might be harder to make it fit in some corners, it could require quite a lot of manual vertex transformation.


    EDIT:
    I think I could make the mesh denser, because the track is so short and the point cloud is so dense. The problem is almost invisible with smaller quads. But how dense do you think I could go? Track width is 7,5 - 8 meters and it's 800m long. LesiU, do I understand you can easily go up to 10 000 000 tris, which would mean 5 000 000 quads? I wouldn't need that many :D
    View attachment 13915
    View attachment 13916
     
    Last edited by a moderator: Aug 13, 2014
  19. SPASKIS

    SPASKIS Registered

    Joined:
    Sep 7, 2011
    Messages:
    3,155
    Likes Received:
    1,426
    I understand what ypu mean but such perfection does not provide a better result than what you have. I would recommend to move on.
     
  20. Jka

    Jka Member Staff Member

    Joined:
    Jan 31, 2011
    Messages:
    954
    Likes Received:
    213
    I don't think perfect aligment of perpendicular splines is required by game engine. Of course it's easier to map track surface with perfectly aligned splines, but you don't achieve any advantage with game engine (within this tolerance). To me, your mesh looks just fine.

    Also, your quad size looks good. If you wan't you might have slightly denser grid on very tight corners, but overall this resolution is good. Remember, cars needs some polygons too. So don't go astronomical polycount with your track. ;)

    Cheers!
     

Share This Page