POV-Ray : Newsgroups : povray.newusers : map a prism onto a sphere : Re: map a prism onto a sphere Server Time
28 Jul 2024 18:27:31 EDT (-0400)
  Re: map a prism onto a sphere  
From: Tim Attwood
Date: 7 Mar 2008 19:26:49
Message: <47d1dd49$1@news.povray.org>
>Do you have an idea, that helps me?

Something like this... it can take a while to parse,
but you can save it as a mesh, then #include
the mesh instead of generating the mesh
every time.

#declare L = prism{
 cubic_spline
 0,
 1,
 19,
 <0.040627,0.911213>,
 <0.197333,0.998271>,
 <0.377254,0.928624>,
 <0.528155,0.661645>,
 <0.737096,0.133490>,
 <0.893801,0.150901>,
 <0.946036,0.075451>,
 <0.853174,0.017412>,
 <0.655841,0.075451>,
 <0.493332,0.325019>,
 <0.284391,0.011608>,
 <0.214744,0.098666>,
 <0.458508,0.475920>,
 <0.377254,0.789331>,
 <0.220548,0.887997>,
 <0.087059,0.824154>,
 <0.040627,0.911213>,
 <0.197333,0.998271>,
 <0.377254,0.928624>
 scale <0.9,1,0.9>
 translate <0.05,0,0.05>
};

#declare pig = pigment{
   object {
      L
      Black
      White
   }
   rotate <-90,0,0>
   translate <-0.5,-0.5,0>
};

#declare fn_pig = function{pigment{pig}};

#declare fn_H = function {fn_pig(x,y,z).gray};

#ifndef (SHAPES_INC_TEMP) #include "shapes.inc" #end

#declare S = object {
  HF_Sphere(fn_H, off, off, <1000,1000>, on, "", <0,0,0>, 1, 0.01)
};

difference {
   object {S}
   sphere {<0,0,0>,1.005}
   pigment {Yellow}
   rotate <0,0,0>
}


Post a reply to this message

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