|
![](/i/fill.gif) |
>
> Hello,
>
> I made a simple isosurface defined as a cylinder minus a groove :
>
> function { sqrt(pow(x,2) + pow(z,2)) - Groove(x,z) }
>
> with :
>
> Groove = function(a,b) { R + q - 2*q*abs(cos(ang(a,b)))}
>
>
> Now, a want to twist this isosurface along y axis. I found on Internet
> that, x and z must be modified with functions like this :
>
> TwistX = function { x*cos(a*y) - z*sin(a*y) }
> TwistZ = function { x*sin(a*y) + z*cos(a*y) }
>
>
> ok... but how to 'put' this twist's functions 'in' my main isosurface
> function ?
>
>
> this should be simple, but I can not do :(
>
>
> thanks.
>
One possibility would be to add that twist in the function call:
#declare Grooved_Cylinder = function { sqrt(pow(x,2) + pow(z,2)) -
Groove(x,z) }
object{Grooved_cylinder(x*cos(a*y) - z*sin(a*y), y, x*sin(a*y) + z*cos(a*y))
This will displace the sample points passed to the function and make it
look twisted.
To reverse the twisting direction, use -y in the sin and cos.
Alain
Post a reply to this message
|
![](/i/fill.gif) |