POV-Ray : Newsgroups : povray.binaries.images : Rail segments assembly problem : Rail segments assembly problem Server Time
5 Nov 2024 13:23:07 EST (-0500)
  Rail segments assembly problem  
From: Jörg 'Yadgar' Bleimann
Date: 11 Apr 2009 10:37:12
Message: <49e0ab18@news.povray.org>
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'
cabinrailway.png

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.