POV-Ray : Newsgroups : povray.newusers : User-defined object function : Re: User-defined object function Server Time
30 Jul 2024 02:29:00 EDT (-0400)
  Re: User-defined object function  
From: Warp
Date: 25 Nov 2004 10:48:24
Message: <41a5fec8@news.povray.org>
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

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.