POV-Ray : Newsgroups : povray.general : Graininess Server Time
31 Jul 2024 10:19:57 EDT (-0400)
  Graininess (Message 31 to 33 of 33)  
<<< Previous 10 Messages Goto Initial 10 Messages
From: Trevor G Quayle
Subject: Re: Graininess
Date: 15 Jan 2008 08:50:03
Message: <web.478cb9c322fbe8cfc150d4c10@news.povray.org>
"SharkD" <nomail@nomail> wrote:
> "Trevor G Quayle" <Tin### [at] hotmailcom> wrote:
> > You could try:
> >
> > #declare LATRANGE=select(90-SphereGrid_value,1,2,3);
> >
> > #switch (LATRANGE)
> >   #case(1) //Do this for angle < 90
> >   #break
> >   #case(2) //Do this for angle = 90
> >   #break
> >   #case(3)  /Do this for angle > 90
> >   #break
> > #end
> >
> >
> > There may be other more elegant ways...
> > -tgq
>
> No, I was wondering if it would be possible to pass conditional statements to
> the #case calls. This is not the case, so I'll just stick with what I've got.

Unfortuneately the #range keyword is inclusive at both ends ( a<= value <= b).
You could place a #case(90) statement first in the #switch block, and it should
capture the '90' value, then follw with the two #range (or one #range and one
#else), but this seem progamatically a bit sloppy.

-tgq


Post a reply to this message

From: SharkD
Subject: Re: Graininess
Date: 16 Jan 2008 02:35:01
Message: <web.478db38722fbe8cf368884fc0@news.povray.org>
"Trevor G Quayle" <Tin### [at] hotmailcom> wrote:
> You could place a #case(90) statement first in the #switch block, and it should
> capture the '90' value, then follw with the two #range (or one #range and one
> #else), but this seem progamatically a bit sloppy.
>
> -tgq

I agree. Thanks again for your help! I will upload the fixed version to the
Object Collection sometime soon.


Post a reply to this message

From: SharkD
Subject: Re: Graininess
Date: 16 Jan 2008 16:30:00
Message: <web.478e771022fbe8cf368884fc0@news.povray.org>
"Trevor G Quayle" <Tin### [at] hotmailcom> wrote:
> You are still having the same problem with your cones, or rather similar.  You
> are now working from 0 to 180 degrees, with the angle being the angle from the
> north pole.  The cone has a defined height of 2*SphereGrid_radius*y, but the
> radius of the cone is 2*SphereGrid_radius*abs(tand(SphereGrid_value)).  When
> angle=90, tan(90)=undefined, giving you a problematic cone, which happens to be
> the equator gridline.  If you want to continue the way you have it, have an
> additional #if statement for SphereGrid_value=90 which differences a box
> instead.
>
> -tgq

Just out of curiosity, do you think the problem is related specifically to the
cone, or is it a more general case that is applicable to other types of
objects?


Post a reply to this message

<<< Previous 10 Messages Goto Initial 10 Messages

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