POV-Ray : Newsgroups : povray.general : Graininess : Re: Graininess Server Time
31 Jul 2024 08:23:20 EDT (-0400)
  Re: Graininess  
From: Trevor G Quayle
Date: 12 Jan 2008 09:30:00
Message: <web.4788ce0122fbe8cf2ae8612c0@news.povray.org>
"SharkD" <nomail@nomail> wrote:
> "Trevor G Quayle" <Tin### [at] hotmailcom> wrote:
> > Relook at your trig.  You've got it backwards. You are using diameter =
> > 1/tan(angle).  You are also explicitly setting the height to y=1 so the cone
> > will always have a height of 1, not be flat.
> > For angle=0, tan(0)=0, 1/tan(0)=undefined.
> > For angle=90, tan(90)=inf., 1/tan(90)=0.  This does create a line segment, but
> > is unnecessary as I stated.
>
> Woops! You're right. The way you describe it is the way I /intended/ it.
> Somewhere, I must have got the angles mixed up. BTW, I noticed some other
> problems while reviewing this section of the code. For angles greater than 90
> degrees, the /absolute value/ must be used for the cone radius. Otherwise, it
> results in a degenerate cone (all lattitude lines below the equator were being
> omitted).

Yes I noticed this and mentioned it.  I'm not sure how POV is handling them, but
it was causing massive slowdowns for me.

>
> > > You'll notice in the example scene I provided that you can now see inside the
> > > sphere in certain places, as if I'd used the clipped_by statement instead of
> > > difference.
> >
> >
> > Not sure what you mean here.
>
> You'll have to render the scene to see it (after applying the changed code). The
> very last difference statement (the corner cut-away) now cuts into the sphere so
> that you can see the insides of the (solid!) objects, as if a clipped_by
> statement were being used instead.
>
> I posted the exact scene file a few messages ago. The only thing that needs to
> be changed is the "SphereGrid_thickness" parameter of the macro call. Increase
> it to something larger (but not too large!), like 0.05. This will widen the
> gaps between the segments large enough to see some noisy surfaces adjacent to
> the gaps.

Hmm, I can't see either of these.  Maybe repost your scene and macro.  Perhaps
something is different (My changes or yours).  Is it still there after you fix
the negative cone issue above?

BTW, this is how I fixed the latitude grids:
(You can ignore the formatting changes, I just made them the way I like to see
them)

//START
  #local SphereGrid_increment = 1/SphereGrid_lattt*2;
  #local SphereGrid_i = 0;
  #local SphereGrid_start =
SphereGrid_increment-SphereGrid_offset*SphereGrid_increment/2;
  #while(SphereGrid_i < SphereGrid_lattt/2)
   #local
SphereGrid_value=90*(SphereGrid_start+SphereGrid_i*SphereGrid_increment);
   #if (SphereGrid_value=90)
     cylinder{-SphereGrid_thickness/2*y,SphereGrid_thickness/2*y,1.1}
   #else
    #declare j=-1;#while (j<=1)
      difference{
       cone{
        0, 0,
        y*2, tand(SphereGrid_value)*2
        translate -y/sind(SphereGrid_value)*SphereGrid_thickness/2
       }
       cone{
        0, 0,
        y*2, tand(SphereGrid_value)*2
        translate y/sind(SphereGrid_value)*SphereGrid_thickness/2
       }
        scale <1,j,1>
      }
        #declare j=j+2;#end
   #end
//END

-tgq


Post a reply to this message

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