POV-Ray : Newsgroups : povray.general : Groves in sphere Server Time
15 Nov 2024 17:14:02 EST (-0500)
  Groves in sphere (Message 1 to 2 of 2)  
From: no email@here sorry
Subject: Groves in sphere
Date: 17 Jul 2004 06:45:35
Message: <Xns952981CF4EA51noemailheresorry@203.29.75.35>
Hi,
I want to growe few rows on a sphere surface - how can I do it?

One of ideas would be to difference a sphere with a part of torus with same radius 
and center.

difference {
  sphere { 0 R }
  intersection {
    torus { R 0.05 }
    box { ... } // only part of torus
    rotate ...
  }
  [... more intersections ...]
}

I would rather like to have my bups/groves in a .bmp file... so I need something 
like height_field, but wrapped into a sphere (I will need only a small part of 
sphere about 1/10th of its surface so distorsions aroud "edges" of sphere/texture 
- is not a problem)

Other soulution would be maybe to use  
sphere { 0 R  normal { bump_map { bmp ..... 
but I need very realistic results, normals are not enought.

Hmm maybe some isosurface (or parametric) - but this soulution is very slow...

Or maybe some macro to generate a curved heightfield from an pattern / image? (or 
just to generate an HF-mesh, I will try to adjust it)  or any other sugestions.. 
:) ?


Post a reply to this message

From: Mike Williams
Subject: Re: Groves in sphere
Date: 17 Jul 2004 07:07:23
Message: <iGokfAAleQ+AFwPR@econym.demon.co.uk>
Wasn't it no.### [at] heresorry who wrote:
>Hi,
>I want to growe few rows on a sphere surface - how can I do it?
>
>One of ideas would be to difference a sphere with a part of torus with same 
>radius 
>and center.
>
>difference {
>  sphere { 0 R }
>  intersection {
>    torus { R 0.05 }
>    box { ... } // only part of torus
>    rotate ...
>  }
>  [... more intersections ...]
>}
>
>I would rather like to have my bups/groves in a .bmp file... so I need something 
>like height_field, but wrapped into a sphere (I will need only a small part of 
>sphere about 1/10th of its surface so distorsions aroud "edges" of 
>sphere/texture 
>- is not a problem)
>
>Other soulution would be maybe to use  
>sphere { 0 R  normal { bump_map { bmp ..... 
>but I need very realistic results, normals are not enought.
>
>Hmm maybe some isosurface (or parametric) - but this soulution is very slow...

Simple isosurfaces like this are not all that slow. Try this for grooves
that follow lines of latitude. It only takes about 7 times longer than
rendering a plain sphere{0,1}.

#include "functions.inc"
#declare Frequency=60;
#declare Depth=0.02;

isosurface {
  function {f_sphere(x,y,z,1) + sin(Frequency*f_ph(x,y,z))*Depth}
  max_gradient 1.8
  contained_by {sphere {0,1}}
  pigment {rgb 1}
}

If you don't want sharp edges on the sides of the grooves use

  contained_by {sphere {0,1+Depth}}

For lines of longitude use

  sin(Frequency*f_th(x,y,z))

For lines of latitude that get closer near the equator use

  sin(Frequency*y)

-- 
Mike Williams
Gentleman of Leisure


Post a reply to this message

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