POV-Ray : Newsgroups : povray.general : Most efficient way to code a hemisphere (lathe.inc) : Re: Most efficient way to code a hemisphere (lathe.inc) Server Time
29 Jul 2024 14:11:43 EDT (-0400)
  Re: Most efficient way to code a hemisphere (lathe.inc)  
From: W0RLDBUILDER
Date: 29 Apr 2011 15:20:01
Message: <web.4dbb0e4a36e168b6b8f6b920@news.povray.org>
"gregjohn" <pte### [at] yahoocom> wrote:
> Hi. I was trying to find the most efficient way to code a mesh for a perfect
> hemisphere.  I could probably do it if I were to break out a while loop with a
> couple thousand entries in the spline based on trig functions.  But it would
> really help to know the simplest way to define one.  So far I haven't hit on it
> with quadratic spline, supposed I will next try cubic.
>
> TIA for any help.
>
>
> #version 3.5;
> #include "lathe.inc"
>
> global_settings {assumed_gamma 1.0}
> camera {location <0,2,-5.5> look_at <0,0,0>}
> light_source {<500,500,-500> rgb <0.8,0.9,1>}
> light_source {<-10,3,0> rgb <1,1,0.8>}
>
>
> #declare bd=2;
>
> #declare S1=spline{
>    quadratic_spline
>   -1.00,<-2,0,0>
>    0.00,< 0,2,0>
>    1.00,< 2,0,0>
>    2.00,< 0,-2,0>
> }
>
> object {
>    Lathe(S1, 100, 360, 50, "")
>    uv_mapping
>    pigment{checker color rgb <0,0,0.2> color rgb <1,0.85,0.85> scale 0.05}
>    finish{specular 0.4}
> }

It's not a mesh, but try a CSG with a plane and a sphere.
difference {
  sphere { <1, 0, 0>, 1 pigment { rgb 1 } }
  plane { y, 0 pigment { rgb 1 } }
}

Invert it by adding rotate x*180.
difference {
  sphere { <1, 0, 0>, 1 pigment { rgb 1 } }
  plane { y, 0 pigment { rgb 1 } rotate x*180 }
}


Post a reply to this message

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