POV-Ray : Newsgroups : povray.general : Transform to a spline without loop-de-loops : Re: Transform to a spline without loop-de-loops Server Time
29 Jul 2024 14:23:11 EDT (-0400)
  Re: Transform to a spline without loop-de-loops  
From: clipka
Date: 9 Mar 2011 08:31:30
Message: <4d778132$1@news.povray.org>
Am 09.03.2011 13:36, schrieb gregjohn:

>> Also, beware of z+0.0001 ... it's<0.0001, 0.0001, 1.0001>  !
>>
>
> This I found to be necessary for any use of Reorient. If you transform from z to
> z, it bombs out with singular matrix in inverse thing.  Not helpful.

I guess if you leave it like that, tansforming may still bomb in case 
the new vector happens to be z+0.0001.

>>   I would (as I do with procedural
>> meshes) use one point behind and one ahead as my forward vector,
>> which should be approximately close to the tangent of the current point.
>
> I don't think this is a universal solution. I'd like it to work for any spline,
> whether it's ten points widely spaced along a natural_spline curve, or one
> defined with a thousand points set up via trig functions.  I had an application
> where I wanted it to walk around obstacles, and so I only needed to set up ten
> points that avoided the obstacles. "Next point" would disrupt that system.

I guess his suggestion is to use

   #declare bodypos0=<0,0,0>+bodypath(clock-1e-4); // (!!!)
   #declare bodypos1=<0,0,0>+bodypath(clock+1e-4);

which doesn't really harm what you're doing, and should indeed typically 
be closer to the tangent.


Post a reply to this message

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