POV-Ray : Newsgroups : povray.advanced-users : can some one help me with rotational extrapolation !!! ? : Re: can some one help me with rotational extrapolation !!! ? Server Time
29 Jul 2024 20:24:38 EDT (-0400)
  Re: can some one help me with rotational extrapolation !!! ?  
From: Wlodzimierz ABX Skiba
Date: 10 Jan 2001 04:38:45
Message: <3a5c2da5@news.povray.org>
Adam Gibbons wrote in message <3a5bac30@news.povray.org>...
> if some one out there can tell me how you do this then not only would I be
> most grateful BUT I will make a windows application that will allow people
> to easily do extrapolation in the future and I will make it totally free for
> every one at POV-RAY to use. that is after I have finished making the dam
> thing.


everything what you need is set of some macros working in MegaPov
but this could be possible in pure POV

#macro TransformObjectAndPoints(Trans)
  #local counter=0;
  #while (defined(ControlPoints[counter]))
    #declare ControlPoints[counter]=vtransform(ControlPoints[counter],Trans);
    #local counter=counter+1;
  #end
  transform Trans
#end

#macro RotateObjectAndPoints(Angle)
  #local Trans=transform{rotate Angle}
  TransformObjectAndPoints(Trans)
#end

#macro ScaleObjectAndPoints(S)
  #local Trans=transform{scale S}
  TransformObjectAndPoints(Trans)
#end

#macro TranslateObjectAndPoints(Vector)
  #local Trans=transform{translate Vector}
  TransformObjectAndPoints(Trans)
#end

and now your scene

#declare ControlPoints=array[2]
// center of sphere
#declare ControlPoints[0]=<0.68,(0.425/2)+0.09,0>;
// radius and point somwhere on sphere
#declare Radius=0.1
#declare ControlPoints[1]=ControlPoints[0]+(Radius*y);

sphere
{
ControlPoints[0] Radius
TranslateObjectAndPoints(<0,0.85,0>)
ScaleObjectAndPoints(<0.75,0.75,0.75>)
RotateObjectAndPoints(< 10 ,-45, -20>)
TranslateObjectAndPoints(<-0.7,-0.1, 00>)
pigment{Red}
}

#declare NewCenter = ControlPoints[0];
#declare NewRadius = vlength(ControlPoints[1]-ControlPoints[0]);

this is not tested but I hope it works

ABX


Post a reply to this message

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