POV-Ray : Newsgroups : povray.general : First object in macro is not rendered. : Re: First object in macro is not rendered. Server Time
12 May 2024 15:05:55 EDT (-0400)
  Re: First object in macro is not rendered.  
From: William F Pokorny
Date: 8 Sep 2023 17:07:41
Message: <64fb8d1d$1@news.povray.org>
On 9/8/23 16:16, Bald Eagle wrote:
> #macro Test (startX, startY, targetX, targetY)
>   //sphere {0, 0}
>   sphere {<startX, startY, 0> 0.1 pigment {rgb z}}
>   sphere {<targetX, targetY, 0> 0.1 pigment {rgb y}}
> 
>   #declare Result = 1;
> 
>   //Result
> 
> #end
> 
> #declare myResult = Test (1, 3, 4, 2);

If we flatten the macro call, I believe what is showing up in the scene 
at the top is:

//---
#declare myResult = sphere {0, 0}

sphere { <1, 3, 0>, 0.1 pigment rgb <0,0,1> }
sphere { <4, 2, 0>, 0.1 pigment rgb <0,1,0> }

$declare Result = 1;
//---

In other words, I think you need a union{} wrap of the spheres inside 
that macro - or don't do the assignment to myResult. The additional 
sphere prevents the assignment to the myResult identifier from eating 
the first non-dummy sphere; it instead eats the dummy one.

Bill P.


Post a reply to this message

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