|
![](/i/fill.gif) |
"Charles C" <nomail@nomail> wrote:
> Nice tracks!
Thanks!
> Years ago I wrote a system in SDL to give a car sequential commands to drive
> around. If I wanted to tweek earlier turns, accelerations (etc), the end point
> of the path would change wildly which made it challenging.
>
> If it were me, I'd keep the track placement independent of earlier pieces and
> figure out the path of the train after-the-fact. E.g don't work with relative
> distances and turns but absolute positions and orientations - pretty manual.
> Make sure each track piece can have exactly several (?)* allowable rotations
> and allow them to be placed on a grid making placement relatively quick. I
> guess that's still similar to your #1. Once the track is built, the path
> (spline) intended for train placement can be created by listing track pieces
> and grid positions. Forks can be ignored for the (spline) path creation by
> substituting non-forked equivalent pieces instead.** Afterall you probably
> won't have a bifercated train (unless it was going too fast!).
> Anyway this is fun stuff to think about. :)
>
> Charles
>
> *I haven't played with these tracks with my nephews in a while so I don't know
> how many angles are possible or how fine of a grid would be necessary.
>
> ** Here a "piece" = ~3 points for the purpose of spline creation, not the model.
This does make a lot of sense, one doesn't want to have all the later
positioning have to be reworked if a small change near the beginning is made.
Griding might be feasible, "standard" track proportions do conform to a grid to
a point. The track macros allow arbitrary lengths/curves/etc, however I also
made a set of helper macros to make tracks of standard proportions. Wikipedia
was helpful here:
http://en.wikipedia.org/wiki/Wooden_toy_train#Some_track_and_layout_geometry
Basically, straight lengths are all some fraction of the diameter of a standard
circle. Curved pieces are nearly all 45 degrees = 8 pieces per circle. So for
a given diameter, one can derive nearly all the other sizes. The images at the
link show how they fit on a grid. I think the biggest question would how to
structure the user input so its easy enough to use.
Thanks for the input.
-The Mildly Infamous Blue Herring
Post a reply to this message
|
![](/i/fill.gif) |