POV-Ray : Newsgroups : povray.binaries.animations : Re: Torus Torture : Re: Torus Torture Server Time
21 Jul 2024 05:30:44 EDT (-0400)
  Re: Torus Torture  
From: Wlodzimierz ABX Skiba
Date: 22 Jan 2001 07:01:12
Message: <3a6c2108@news.povray.org>
Rune wrote in message <3a68a791@news.povray.org>...
> With my macros user-defined deformations are very easy simple.
> This is a simple twist:
>
> #macro deform_mezz (P) vrotate(P,120*x*P.x) #end
>
> How would a user-defined twist look with your patch?
> (I do *not* mean the build-in twist-deform. I mean user-defined function!)


I think such thing should be possible after my whole patching

#declare Twisting=function(speed=120,A[3]=<0,1,0>,P[3])
   { VRotate( P, VScale( speed, A )) }

where VRotate and VScale are previous defined or build-in functions, i.e.:

#declare VScale=function(a=1,V[3]=<1,2,3>)
  {
    local V1[3]
    local V1[0]=a*V[0]
    local V1[1]=a*V[1]
    local V1[2]=a*V[2]
    V1
  }

and with such definitions you can write what you want

twisting along y with default speed
  box { -1 1 deform { Twisting() } }
twisting along y with new speed
  box { -1 1 deform { Twisting(130) } }
twisting along x with new speed
  box { -1 1 deform { Twisting(100,x) } }

and remember that this deform both: geometry and texturing
is this simple enough ?

but I still prefer some simple build-in deformations
becouse they have not aproximated normals
and are calculated internally/faster
(not parsed during every calculation)

ABX


Post a reply to this message

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