PDA

View Full Version : PTH files converted to WPF


DarkTimes
15th March 2010, 13:29
I've been messing around with WPF (http://msdn.microsoft.com/en-us/library/ms754130.aspx) quite a bit and I've converted all the LFS .pth (http://www.lfs.net/?page=coderfiles) files to XAML (http://msdn.microsoft.com/en-us/library/ms752059.aspx), so it's easy to drop a track model into your WPF app!

I've included the download below, but I also made a simple track viewer demo with WPF for the .NET Framework 3.5 (http://www.hanselman.com/smallestdotnet/). It works pretty well I feel, although could do with some more work.

You can pan the track by dragging the mouse and can zoom in and out with either the mouse wheel or the +/- keypad buttons. You can reset the view by pressing esc.

Thanks!

Flame CZE
15th March 2010, 13:51
Quite useful, nice :)
I always wondered how to display an image from the PTH files. I tried with php imageGD and it always returned some random points, I don't know why :(

DarkTimes
15th March 2010, 15:52
Quite useful, nice :)
I always wondered how to display an image from the PTH files. I tried with php imageGD and it always returned some random points, I don't know why :(
I'd suggest looking at the code for the LFS Replay Analyse (http://www.lfsforum.net/showthread.php?t=20056)r, I learned a lot from there. Most of the interesting stuff is in track.cpp, trackmap.cpp and trackpath.cpp.

DarkTimes
15th March 2010, 17:33
Updated the TrackViewer demo to add world coordinates in the bottom left corner of the screen, these are LFS world-coordinates given in meters. I also coloured the non-track background a light grey, which makes it easier to see where the "LFS world" begins and ends.

Dygear
15th March 2010, 19:14
Extremely cool!