High!
Another raytracing and video editing weekend with my loved one... I
started a medium-sized project dealing with an automatic commuter maglev
train system (to be later on implemented in some futuristic city), first
the rail segments, for which I programmed two macros (see code on p.b.s-f.).
These macros (StraightRail() and BendRail()) are invoked according to
data read in from an ASCII text file (attached here) and stored in a
two-dimensional array. The format of the data is as follows:
1. Segment type (0 for "straight", 1 for "bend")
2. Length (if straight)/Arc angle (if bend)
3. Radius (bend only; third value is not read for straight segments)
This array is processed line by line, and the subsequent rail segments
are translated and rotated to fit together. All worked well - unless I
added a bend segment curving "southward". The following straight segment
was placed out of way, as you can see on the attached image.
It seems to be a problem with the z dimension, as the x value is correct...
See you in Khyberspace!
Yadgar
Post a reply to this message
Attachments:
Download 'cabinrailway.png' (11 KB)
Download 'railtest.txt' (1 KB)
Preview of image 'cabinrailway.png'
|