POV-Ray : Newsgroups : povray.general : Mapping Textures on irregular shapes : Re: Mapping Textures on irregular shapes Server Time
21 May 2024 13:12:20 EDT (-0400)
  Re: Mapping Textures on irregular shapes  
From: Bald Eagle
Date: 1 May 2020 17:45:05
Message: <web.5eac981a72e01857fb0b41570@news.povray.org>
"Josh" <nomail@nomail> wrote:

> Here's my attempt to declare that function in povray, but it won't compile...

"Parse".


> #macro sq(X) X*X #end

And that's why.   You can't use a macro in a function.  You CAN use a function
in a macro.

> #declare BOX_SHAPE2=
> function(x,y,z,k1,k2,k3)
> {
>   #declare q = <abs(x), abs(y), abs(z)>-<k1,k2,k3>;
>   sqrt(sq(max(q.x,0))+sq(max(q.y,0))+sq(max(q.z,0)))
>
> }
>
> Josh

I think at this point, with a little experimentation, you can work out why the
above doesn't work.

I'm thinking that there's another, weird way to do this using pigment functions
- then it would be possible to use the dot notation, but the syntax is big,
bulky, and something that I wish could be fixed.


Post a reply to this message

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