the_angry_angel
2nd January 2012, 14:43
Good afternoon chaps,
This winter holiday season I've been playing a bit of LFS and fiddling with nodejs and insim (another project). As part of making that project useful I've also been playing with d3.js (http://mbostock.github.com/d3/), which can be used to draw and manipulate svg data.
The basic premise of this afternoon was that I wanted to draw a rough interpretation of a LFS track. The link below is the fruits of my work.
https://github.com/theangryangel/LFS-.pth---d3.js
I'm using it in conjunction with the nodejs insim client I'm fiddling with to produce a basic ajax based live tracker. Figured someone else might have a use for it as well.
If you do intend on using it, please be aware that I've not included d3.min.js (available from http://mbostock.github.com/d3/) and there are a couple of caveats, most notably:
Track doesn't match the same orientation as LFS - could be acheived reasonably easily using a transform
Doesn't take into account the actual track width - only uses the center coordinates
Despite these draw backs, I think it's good enough for my purposes, and hopefully good enough if anyone else wants to use it.
I've included my own converted pth files, and the implementation I used to convert them. The converted pth files are at 1/6th the "resolution" of the originals as I found that there were just too many data points.
Example image of what it looks out, out of the box, attached.
This winter holiday season I've been playing a bit of LFS and fiddling with nodejs and insim (another project). As part of making that project useful I've also been playing with d3.js (http://mbostock.github.com/d3/), which can be used to draw and manipulate svg data.
The basic premise of this afternoon was that I wanted to draw a rough interpretation of a LFS track. The link below is the fruits of my work.
https://github.com/theangryangel/LFS-.pth---d3.js
I'm using it in conjunction with the nodejs insim client I'm fiddling with to produce a basic ajax based live tracker. Figured someone else might have a use for it as well.
If you do intend on using it, please be aware that I've not included d3.min.js (available from http://mbostock.github.com/d3/) and there are a couple of caveats, most notably:
Track doesn't match the same orientation as LFS - could be acheived reasonably easily using a transform
Doesn't take into account the actual track width - only uses the center coordinates
Despite these draw backs, I think it's good enough for my purposes, and hopefully good enough if anyone else wants to use it.
I've included my own converted pth files, and the implementation I used to convert them. The converted pth files are at 1/6th the "resolution" of the originals as I found that there were just too many data points.
Example image of what it looks out, out of the box, attached.