|
|
|
|
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Is there any way to apply a linear twist to an isosurface?
What I'm after is to twist the heart iso, by about 30 degrees, (+/- 15)
along the Y axis.
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
dave vanhorn wrote:
> Is there any way to apply a linear twist to an isosurface?
>
> What I'm after is to twist the heart iso, by about 30 degrees, (+/- 15)
> along the Y axis.
>
>
Replace x by (x * cos (f (y)) + z * sin (f (y))
Replace z by (-x * sin (f (y)) + z * cos (f (y))
Where f is a function that defines the way you want the surface to
twist (the simplest being K*y for some constant K).
Jerome
- --
+------------------------- Jerome M. BERGER ---------------------+
| mailto:jeb### [at] freefr | ICQ: 238062172 |
| http://jeberger.free.fr/ | Jabber: jeb### [at] jabberfr |
+---------------------------------+------------------------------+
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (GNU/Linux)
iD4DBQFFh6Idd0kWM4JG3k8RAvd0AJiagT8lHXsA0eBixWRAozGS8TawAJ4oBbo1
4ZEwfkyQZMASWwlP5vDOqQ==
=T0fP
-----END PGP SIGNATURE-----
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
> Replace x by (x * cos (f (y)) + z * sin (f (y))
> Replace z by (-x * sin (f (y)) + z * cos (f (y))
Instead of replacing them, wouldn't it be simpler to call the function
with those parameters?
--
- Warp
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
#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
|
|
| |
| |
|
|
|
|
| |
| |
|
|
-----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] freefr | ICQ: 238062172 |
| http://jeberger.free.fr/ | Jabber: jeb### [at] jabberfr |
+---------------------------------+------------------------------+
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (GNU/Linux)
iD8DBQFFiSdtd0kWM4JG3k8RAonfAJ91MyMpKoIaopYBBFFfHQ3B8jLriwCgklTx
yztdKmeOg8vou6y2VdCXH4E=
=vYKm
-----END PGP SIGNATURE-----
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
> 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
|
|
| |
| |
|
|
|
|
| |
| |
|
|
-----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] freefr | ICQ: 238062172 |
| http://jeberger.free.fr/ | Jabber: jeb### [at] jabberfr |
+---------------------------------+------------------------------+
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (GNU/Linux)
iD8DBQFFiaAad0kWM4JG3k8RAqoAAKCSVOVlop8PR1C/SnG41ZPLxY9PpwCgmcYj
jZBew4IDM7tRDhN0j2gxWs0=
=pKXr
-----END PGP SIGNATURE-----
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
> 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
|
|
| |
| |
|
|
|
|
| |
| |
|
|
-----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] freefr | ICQ: 238062172 |
| http://jeberger.free.fr/ | Jabber: jeb### [at] jabberfr |
+---------------------------------+------------------------------+
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (GNU/Linux)
iD8DBQFFiidld0kWM4JG3k8RAh3DAJ0dF0xytvmN7MlW5BoEXTxc/yN1tQCfc0jJ
N45qh28DOPfPJCP7b0mc+94=
=c0cs
-----END PGP SIGNATURE-----
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
>> 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
|
|
| |
| |
|
|
|
|
| |
|
|