POV-Ray : Newsgroups : povray.general : Mixing transformations : Re: Mixing transformations Server Time
30 Jul 2024 16:20:54 EDT (-0400)
  Re: Mixing transformations  
From: Jim Charter
Date: 3 Nov 2008 20:11:55
Message: <490fa15b$1@news.povray.org>
HelveticaFanatic wrote:
> Jim Charter <jrc### [at] msncom> wrote:
> 
>>HelveticaFanatic wrote:
>>
>>>I am modeling trains using Spline_Trans. Is there a way to average out the
>>>points above each wheel set to get a position for the train so that it still
>>>has the banking from Spline_Trans but shift over the side of the track so that
>>>the wheels are above the tracks? Thanks.
>>>
>>>
>>
>>If I am understanding what you want, you can take points from along the
>>spline on either side of a given point, together with the root point you
>>can then use cross product (vcross(A,B) see the docs) to approximate a
>>normal which which would reflect the banking of the spline.  You would
>>'normalize it of course and then multiply by the radius of your wheel to
>>get the level where the axle would be.  If you don't quite understand
>>what I mean, I would suggest you research what cross product is and work
>>backward from there to a solution.
>>
>>-Jim
> 
> 
> I think that this is just regular banking (I use Spline_Trans for that now). I
> need to simulate a train where there are two wheel sets on the track. I need to
> take the Spline_Trans translation and rotation for each wheel set to determine
> the position of the train (the center point of the train of course will not be
> over the center of the track, only the centers of the bogies). I want to carry
> over the bank angle and make the train actually fit over the curve.
> 
> 
Yes, see my other response.  With that code snip I showed you, you 
should be able to contrive an answer to your needs. It utilizes the same 
macro that you would use to position an object along the spline, 
including what ever bank settings you use, to predict where any point 
would also be relative to the spline also. It strikes me that there is 
no one way to organize this though.  For instance, what do you what the 
spline to actually define?  The center line between the two rails?  Once 
you arrive at that definition, the rest should follow.


Post a reply to this message

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