|
|
Le 17-12-24 à 09:10, Pablo a écrit :
> Wow, that's exactly what I want to do! But I don't know what equation to
> non-linearly you have put instead of the y on the "sine sphere". That's the
> point for me. So it's this function:
>
> sqrt( x*x + y*y + z*z ) - 0.9
> + sin( 12*atan2(x, z) )*0.051
>
> (isn't it?) but on both y's that appear on the sqrt what should I replace for?
> Thanks for all the attention. (I haven't seen the work you done seting the
> product until today, i'm new on this web site. I'm so thankful, seriusly)
>
>
You need to use the Y component to alter the X and Z components.
Using #include"functions.inc" then using f_sphere(x,y,z,Radius) will be
much faster as it will use compiled code instead of a user defined function.
Also, look at my older posts : I sugest using some other base shapes
that are already pointy at one pole and round at the other. You only
have to stretch those if you want to.
Assuming that your sphere start at 1 unit radius and is centered at the
origin, then you can do this :
sqrt( x*x*(y/2+1.00001) + y*y + z*z*(y/2+1.00001) )
[slow]
OR
f_sphere( x*(y/2+1.00001) + y + z*(y/2+1.00001),1 )
[faster for the exact same shape]
This will scale horizontally by an amount that depend on the Y position.
The "+0.00001" ensure that the scaling never drop to zero, and the "+1"
shift it down so that you get a point at the bottom.
For the ribs, the best way is to use a function made out of the radian
pattern, modified by a frequency, and using sin_wave to ensure a correct
wavy surface shift.
As I proposed elsewhere:
#declare F_Ribs= function{pattern{(radial frequency 10 sin_wave
color_map{[0 rgb 0][1 rgb 1]}).red}}
Adjust the frequency value to get the desired number of ribs. Here, you
get 10 ribs.
The color_map is used to replace the default one.
".red" is used to get a single float and not a colour vector. I could
have used .green, .blue or .grey to get the same effect. .grey will
evaluate slower than the other 3.
And, finally, you get this :
isosurface{
function{
threshold 0
f_sphere( x*(y/2+1.00001), y, z*(y/2+1.00001),1 )
+F_Ribs( x*(y/2+1.000011), 0, z*(y/2+1.000011))
max_gradient 2.5
}
scale <1,3,1>
}
Post a reply to this message
|
|