![](/i/fill.gif) |
![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
#ifndef (SolidHeart)
#ifndef (TwistHeart)
// Original untwisted version
#declare Heart_Function = function { f_torus
(y-pow(abs(x),Sharpness)*Bend, z*1, x, 0.8,0.1) }
#else
//Twisted version
#declare K = 1; //Not sure where to set this yet, try 1.0
#declare f = function {K*y}
#declare Twist_x = function(x,y,z,f) //<-- Errors here with "expected
parameter identifier, function identifier found instead"
{x * cos (f (y)) + z * sin (f (y))}
#declare Twist_z = function(x,y,z,f)
{(-x * sin (f (y)) + z * cos (f (y))}
#declare Heart_Function = function { f_torus (y-pow(abs(x * cos (f
(y)) + z * sin (f (y))),Sharpness)*Bend,
(-x * sin (f (y)) + z *
cos (f (y))*1),
(x * cos (f (y)) + z *
sin (f (y))),
0.8,0.1) }
#end
#else
#declare Heart_Function = function { f_sphere
(y-pow(abs(x),Sharpness)*Bend, z*2, x, 0.6 ) }
#end
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
dave vanhorn wrote:
> #declare Twist_x = function(x,y,z,f) //<-- Errors here with "expected
> parameter identifier, function identifier found instead"
Replace this line with:
#declare Twist_x = function(x, y, z)
You can't pass a function identifier as a parameter to another
function, but you don't need to to be able to call it (huh, does
that sentence make sense?).
Jerome
- --
+------------------------- Jerome M. BERGER ---------------------+
| mailto:jeb### [at] free fr | ICQ: 238062172 |
| http://jeberger.free.fr/ | Jabber: jeb### [at] jabber fr |
+---------------------------------+------------------------------+
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (GNU/Linux)
iD8DBQFFiSdtd0kWM4JG3k8RAonfAJ91MyMpKoIaopYBBFFfHQ3B8jLriwCgklTx
yztdKmeOg8vou6y2VdCXH4E=
=vYKm
-----END PGP SIGNATURE-----
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
> Replace this line with:
> #declare Twist_x = function(x, y, z)
>
> You can't pass a function identifier as a parameter to another
> function, but you don't need to to be able to call it (huh, does
> that sentence make sense?).
I guess not :) I'm still lost. Here's the current implementation
#ifndef (SolidHeart)
#ifndef (TwistHeart)
#declare Heart_Function = function { f_torus
(y-pow(abs(x),Sharpness)*Bend, z*1, x, 0.8,0.1) }
#else
#declare K = 1;
#declare f = function {K*y}
#declare Twist_x = function (x,y,z)
{x * cos (f (y)) + z * sin (f (y))} <-- "Invalid
number of parameters, 1 supplied, 3 required.
#declare Twist_z = function (x,y,z)
{(-x * sin (f (y)) + z * cos (f (y))}
#declare Heart_Function = function { f_torus
(y-pow(abs(Twist_x),Sharpness)*Bend,
(Twist_z*2),
(Twist_x,
0.8,0.1) }
#end
#else
#declare Heart_Function = function { f_sphere
(y-pow(abs(x),Sharpness)*Bend, z*2, x, 0.6 ) }
#end
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
dave vanhorn wrote:
> #declare f = function {K*y}
> #declare Twist_x = function (x,y,z)
> {x * cos (f (y)) + z * sin (f (y))} <-- "Invalid
> number of parameters, 1 supplied, 3 required.
The problem is in the declaration for f. Try one of the following
instead:
#declare f = function {K*x}
or
#declare f(y) = function {K*y}
Jerome
- --
+------------------------- Jerome M. BERGER ---------------------+
| mailto:jeb### [at] free fr | ICQ: 238062172 |
| http://jeberger.free.fr/ | Jabber: jeb### [at] jabber fr |
+---------------------------------+------------------------------+
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (GNU/Linux)
iD8DBQFFiaAad0kWM4JG3k8RAqoAAKCSVOVlop8PR1C/SnG41ZPLxY9PpwCgmcYj
jZBew4IDM7tRDhN0j2gxWs0=
=pKXr
-----END PGP SIGNATURE-----
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
> The problem is in the declaration for f. Try one of the following
> instead:
>
> #declare f = function {K*x}
>
> or
>
> #declare f(y) = function {K*y} <-- This one errors, wants an '=' not '('
#declare K = 1;
#declare f = function {K*x}
#declare Twist_x = function (x,y,z) {( ( x * cos (f(y))) + (z * sin
(f(y))) )}
#declare Twist_z = function (x,y,z) {( (-x * sin (f(y))) + (z * cos
(f(y))) )}
#declare Heart_Function = function { f_torus
(y-pow(abs(Twist_x),Sharpness)*Bend,
Twist_z,
Twist_x,
0.8,0.1) }
Very frustrated.. :(
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
dave vanhorn wrote:
>> The problem is in the declaration for f. Try one of the following
>> instead:
>>
>> #declare f = function {K*x}
>>
>> or
>>
>> #declare f(y) = function {K*y} <-- This one errors, wants an '=' not '('
>
Uh, yes sorry it should have been:
#declare f = function (y) {K*y}
> #declare K = 1;
> #declare f = function {K*x}
> #declare Twist_x = function (x,y,z) {( ( x * cos (f(y))) + (z * sin
> (f(y))) )}
> #declare Twist_z = function (x,y,z) {( (-x * sin (f(y))) + (z * cos
> (f(y))) )}
>
> #declare Heart_Function = function { f_torus
> (y-pow(abs(Twist_x),Sharpness)*Bend,
> Twist_z,
> Twist_x,
> 0.8,0.1) }
>
>
> Very frustrated.. :(
>
Why? Didn't the code you just posted work?
Jerome
- --
+------------------------- Jerome M. BERGER ---------------------+
| mailto:jeb### [at] free fr | ICQ: 238062172 |
| http://jeberger.free.fr/ | Jabber: jeb### [at] jabber fr |
+---------------------------------+------------------------------+
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (GNU/Linux)
iD8DBQFFiidld0kWM4JG3k8RAh3DAJ0dF0xytvmN7MlW5BoEXTxc/yN1tQCfc0jJ
N45qh28DOPfPJCP7b0mc+94=
=c0cs
-----END PGP SIGNATURE-----
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
>> Very frustrated.. :(
>>
> Why? Didn't the code you just posted work?
Nope, it errors out, I'm not finding the error messages, or even where it's
pointing to when it errors, to be all that helpful.
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
"dave vanhorn" <mic### [at] gmail com> wrote:
> >> Very frustrated.. :(
> >>
> > Why? Didn't the code you just posted work?
>
> Nope, it errors out, I'm not finding the error messages, or even where it's
> pointing to when it errors, to be all that helpful.
Hi,
Perhaps K3DSurf can help since it can generate formulas for twisted
isosurfaces from an original one. You can then "see" the result before
using the generated twisted iso in your code. Supported deformations are
twisting and scaling for isosurfaces and parametric surfaces.
Cheers,
Taha
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
I have tweaked a bit some parts, but this works as it should:
#declare Bend=0.5;
#declare Sharpness=0.8;
#declare SolidHeart = 0;
#declare TwistHeart = 1;
#if (!SolidHeart)
#if (!TwistHeart)
// Original untwisted version
#declare Heart_Function =
function { f_torus (y-pow(abs(x),Sharpness)*Bend, z*1, x, 0.8,0.1) }
#else
//Twisted version
#declare K = 1; //twist angle
#declare f = function (y){K*y}
#declare Twist_x = function (x,y,z){( x*cos(f(y)) + z*sin(f(y)))}
#declare Twist_z = function (x,y,z){(-x*sin(f(y)) + z*cos(f(y)))}
#declare Heart_Function =
function { f_torus (y-pow(abs(Twist_x(x,y,z)),Sharpness)*Bend,
Twist_z(x,y,z)*1,Twist_x(x,y,z), 0.8,0.1) }
#end
#else
#declare Heart_Function = function { f_sphere
(y-pow(abs(x),Sharpness)*Bend, z*2, x, 0.6 ) }
#end
Thomas
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
"Thomas de Groot" <t.d### [at] inter nlDOTnet> wrote in message
news:458b98d3@news.povray.org...
>I have tweaked a bit some parts, but this works as it should:
I see! Thanks so much. I was fumbling in the dark there.
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |