|
|
|
|
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Hallo!
How can I define a function that constructs an object depending on a
parameter?
For exampel
ball(t, r)
should give something like
sphere { < t, 0, 0> , r}
Bets wishes Jan
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Jan Fricke <fri### [at] mathuni-siegende> wrote:
> How can I define a function that constructs an object depending on a
> parameter?
> For exampel
> ball(t, r)
> should give something like
> sphere { < t, 0, 0> , r}
Not possible with a function, but with a #macro it's easy:
#macro ball(T, R)
sphere { <T, 0, 0>, R }
#end
--
#macro N(D)#if(D>99)cylinder{M()#local D=div(D,104);M().5,2pigment{rgb M()}}
N(D)#end#end#macro M()<mod(D,13)-6mod(div(D,13)8)-3,10>#end blob{
N(11117333955)N(4254934330)N(3900569407)N(7382340)N(3358)N(970)}// - Warp -
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Warp wrote:
> Jan Fricke <fri### [at] mathuni-siegende> wrote:
>
>>How can I define a function that constructs an object depending on a
>>parameter?
>>For exampel
>
>
>>ball(t, r)
>
>
>>should give something like
>
>
>>sphere { < t, 0, 0> , r}
>
>
> Not possible with a function, but with a #macro it's easy:
>
> #macro ball(T, R)
> sphere { <T, 0, 0>, R }
> #end
>
OK, thanks a lot for the fast answer.
Jan
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
|
|