POV-Ray : Newsgroups : povray.newusers : Spline_Trans Help Please! : Re: Spline_Trans Help Please! Server Time
29 Jul 2024 00:25:27 EDT (-0400)
  Re: Spline_Trans Help Please!  
From: Tim Attwood
Date: 12 May 2007 18:01:38
Message: <46463942$1@news.povray.org>
>      Spline_Trans(path,
> Parse Error: Identifier expected, incomplete function call or spline call 
> found instead.
Calls to macros that pass a spline can occasionally
encounter this bug. Calling it repeatedly makes it certain.
(POV is trying to make multiple copies of the spline)

Check the spline_tools.inc macros I posted in p.b.sf a while back
http://news.povray.org/povray.binaries.scene-files/thread/%3C44e2e8f3@news.povray.org%3E/?ttop=240776&toff=50

This should let you extrude some shapes,  etc.
The heart of the macros is the VSpline_Trans_Path macro,
I worked around the bug by declaring Path_Spline
as a global variable...

// transforms a vector by a matrix
#macro VMatrix_Trans(vec, A, B, C, D)
   #local fn = function { transform {
      matrix < A.x, A.y, A.z,
             B.x, B.y, B.z,
             C.x, C.y, C.z,
             D.x, D.y, D.z>
             } }
   #local result = (fn(vec.x, vec.y, vec.z));
   (result)
#end

// transforms a vector along Path_Spline
#macro VSpline_Trans_Path (Vect, Time, Sky, Foresight, Banking)
   #ifndef (Path_Spline)
      #error "VSpline_Trans_Path requires Path_Spline to be #declared!\n"
   #end
   #local Location = <0,0,0>+Path_Spline(Time);
   #local LocationNext = <0,0,0>+Path_Spline(Time+Foresight);
   #local LocationPrev = <0,0,0>+Path_Spline(Time-Foresight);
   #local Forward = vnormalize(LocationNext-Location);
   #local Right   = VPerp_To_Plane(Sky,Forward);
   #local Up      = VPerp_To_Plane(Forward,Right);
   #local BankingRotation =
   degrees(atan2(
      VRotation(
         VProject_Plane((LocationNext-Location),Sky),
         VProject_Plane((Location-LocationPrev),Sky),
         Up
      )*Banking
      ,1
   ));
   #local result = vrotate(Vect, BankingRotation*z);
   #local result = VMatrix_Trans(result,Right,Up,Forward,Location);
   (result)
#end


Post a reply to this message

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