POV-Ray : Newsgroups : povray.general : Center of OBJECT : Re: Center of OBJECT Server Time
1 Aug 2024 10:18:57 EDT (-0400)
  Re: Center of OBJECT  
From: Chris B
Date: 21 Nov 2005 10:16:40
Message: <4381e4d8$1@news.povray.org>
"Andrej" <and### [at] emailwithoutspamsi> wrote in message 
news:4381d16b@news.povray.org...
>I have a offset problem with object balls. With box, it's ok. If I change 
>the Wi and Hi, the box will remain in center but the balls wouldn't.
>   ... snip ... #declare Hi=4;
>   ... snip ...
> #declare OffsetY=-Hi/2; // Ouch...
>   ... snip ...
>  #while (CountY < Hi)
>   ... snip ...
> object {balls translate <OffsetX, OffsetY, 0>}
>

Hi,

Your 'while' loop continues while CountY is less than Hi. ie. from CountY = 
0 to CountY = 3, so you draw a sphere from 0 to 3, then you offset the array 
of spheres by -2, so it won't be centred.
You probably want to use:  #while (CountY <= Hi)

Regards,
Chris B.


Post a reply to this message

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