POV-Ray : Newsgroups : povray.advanced-users : Question on isosurfaces. Server Time
24 Dec 2024 12:34:20 EST (-0500)
  Question on isosurfaces. (Message 1 to 8 of 8)  
From: CreeD
Subject: Question on isosurfaces.
Date: 6 Aug 2000 15:28:47
Message: <01bffe5d$857f7680$281ba1d0@mk>
Hi.  I'm looking to make a soccer ball-like object that combines
two functions into one isosurface:
A: the ball
and B: The hexagons on the ball. I want these hexagons to be raised, which
is why
I'm using an isosurface and not a sphere with a function as a surface
normal.  

In addition I'm trying to use random numbers to generate random hexagon
colors
on this ball.

Can someone tell me what's wrong with this code?  I have several problems
that have stumped me.

1. Both the hexagon pigment and the isosurface function"FHexagon" tend to
create
the hexagons asymmetrically, so that at the poles of my sphere there are
hexagons,
and these "extrude" downwards along the y axis to the opposite pole. I'd
like
hexagons all around the equator as well.

2. If I use a rounded box instead of a sphere 
(function "rounded_box" <3> gets me a sphere) 
the pigment seems to map a little more normally, but the isosurface
function still looks wrong and keeps 'cubing' my sphere to boot. My
temporary fix is to just contain it with a sphere instead of a box.

3. The pigments in my hexagon pattern (which are semi random) seem to
affect whether the isosurface shows up at all and change the shape.  I
guess I should declare one pigment for the function and a different one for
the texture, but if I can work around this I'd like to.  In any case, I
seem to remember a page with a tutorial on how to make a pigment 3D, and
the example used was a crackle pattern made into an isosurface function and
then added to a sphere function to get a crackly sphere.  How does that
work? (and what happened to the page?)

code below:

#declare PHexagon = 
pigment {hexagon
  color rgb <2,2,2>+10*rand(RandColor)
  color rgb <2,4,2>*rand(RandColor)
  color rgb <1,2,4>-rand(RandColor)
	}

#declare FHexagon = function {pigment {PHexagon}} 

#declare FRBox = function {"rounded_box" <3>}

#declare FBoxSurface =
function {FRBox
         |    FHexagon(x,y,z)*10 
//The or bar is there because "+" and "&" never seem to work... 
             }

isosurface {

     function {FBoxSurface}
     
contained_by {sphere {<0,0,0>,3}} 
//but what I really want is a box so you can see
//the hexagon ridges...
 
eval     threshold  5     method 2 
//tweaking the threshold helps make it visible, but not correct ...

texture {
 pigment{function{FHexagon}
  color_map {
   [0 color rgbf<rand(RandColor)*rand(RandColor), 
               rand(RandColor),
               rand(RandColor),0>] 
   [.3 color rgbf<rand(RandColor).4,
               rand(RandColor)^2,
               rand(RandColor)*rand(RandColor),0>]
   [1  color
rgbf<rand(RandColor)+.5,rand(RandColor)+.3,2*rand(RandColor)^2+.5,0>] 
  
   }//end color map
  }//end pigment 
//normal {function {FHexagon(x*10,y*10,z*10)*10}scale 10 rotate x*-90}
//The normal looks okay but it's not what I want.
}//end texture
finish {phong 1 phong_size 2 ambient .2}
rotate x*90} //end iso


Post a reply to this message

From: ryan constantine
Subject: Re: Question on isosurfaces.
Date: 6 Aug 2000 16:35:47
Message: <398DCBFD.9E9A7B0A@yahoo.com>
to get hexagons to wrap around a sphere, i think you need megapov's uv
mapping.  that's just a guess.  maybe someone with better knowledge will
comment.

CreeD wrote:
> 
> Hi.  I'm looking to make a soccer ball-like object that combines
> two functions into one isosurface:
> A: the ball
> and B: The hexagons on the ball. I want these hexagons to be raised, which
> is why
> I'm using an isosurface and not a sphere with a function as a surface
> normal.
> 
> In addition I'm trying to use random numbers to generate random hexagon
> colors
> on this ball.
> 
> Can someone tell me what's wrong with this code?  I have several problems
> that have stumped me.
> 
> 1. Both the hexagon pigment and the isosurface function"FHexagon" tend to
> create
> the hexagons asymmetrically, so that at the poles of my sphere there are
> hexagons,
> and these "extrude" downwards along the y axis to the opposite pole. I'd
> like
> hexagons all around the equator as well.
> 
> 2. If I use a rounded box instead of a sphere
> (function "rounded_box" <3> gets me a sphere)
> the pigment seems to map a little more normally, but the isosurface
> function still looks wrong and keeps 'cubing' my sphere to boot. My
> temporary fix is to just contain it with a sphere instead of a box.
> 
> 3. The pigments in my hexagon pattern (which are semi random) seem to
> affect whether the isosurface shows up at all and change the shape.  I
> guess I should declare one pigment for the function and a different one for
> the texture, but if I can work around this I'd like to.  In any case, I
> seem to remember a page with a tutorial on how to make a pigment 3D, and
> the example used was a crackle pattern made into an isosurface function and
> then added to a sphere function to get a crackly sphere.  How does that
> work? (and what happened to the page?)
> 
> code below:
> 
> #declare PHexagon =
> pigment {hexagon
>   color rgb <2,2,2>+10*rand(RandColor)
>   color rgb <2,4,2>*rand(RandColor)
>   color rgb <1,2,4>-rand(RandColor)
>         }
> 
> #declare FHexagon = function {pigment {PHexagon}}
> 
> #declare FRBox = function {"rounded_box" <3>}
> 
> #declare FBoxSurface =
> function {FRBox
>          |    FHexagon(x,y,z)*10
> //The or bar is there because "+" and "&" never seem to work...
>              }
> 
> isosurface {
> 
>      function {FBoxSurface}
> 
> contained_by {sphere {<0,0,0>,3}}
> //but what I really want is a box so you can see
> //the hexagon ridges...
> 
> eval     threshold  5     method 2
> //tweaking the threshold helps make it visible, but not correct ...
> 
> texture {
>  pigment{function{FHexagon}
>   color_map {
>    [0 color rgbf<rand(RandColor)*rand(RandColor),
>                rand(RandColor),
>                rand(RandColor),0>]
>    [.3 color rgbf<rand(RandColor).4,
>                rand(RandColor)^2,
>                rand(RandColor)*rand(RandColor),0>]
>    [1  color
> rgbf<rand(RandColor)+.5,rand(RandColor)+.3,2*rand(RandColor)^2+.5,0>]
> 
>    }//end color map
>   }//end pigment
> //normal {function {FHexagon(x*10,y*10,z*10)*10}scale 10 rotate x*-90}
> //The normal looks okay but it's not what I want.
> }//end texture
> finish {phong 1 phong_size 2 ambient .2}
> rotate x*90} //end iso


Post a reply to this message

From: Jan Walzer
Subject: Re: Question on isosurfaces.
Date: 6 Aug 2000 16:55:05
Message: <398dd0a9@news.povray.org>
> Hi.  I'm looking to make a soccer ball-like object that
combines
> two functions into one isosurface:
> A: the ball
> and B: The hexagons on the ball. I want these hexagons to be
raised, which
> is why
> I'm using an isosurface and not a sphere with a function as a
surface
> normal.
Hmm ... afaik a soccer-ball not only consists of hexagons but
also of pentagons ....
mostly the hexas are white and the pentas are black ... this is
needed, because of the "sphere-ing"

--

 ,',    Jan Walzer      \V/  http://wa.lzer.net     ,',
',','   student of      >|<  mailto:jan### [at] lzernet ',','
  '   ComputerScience   /A\  +49-177-7403863         '


Post a reply to this message

From: Peter Popov
Subject: Re: Question on isosurfaces.
Date: 6 Aug 2000 17:20:54
Message: <gilrosokguk9pj3b1v25lgljsbu1eiqg1m@4ax.com>
On 6 Aug 2000 15:28:47 -0400, "CreeD" <mes### [at] nqinet> wrote:

>Hi.  I'm looking to make a soccer ball-like object that combines
>two functions into one isosurface:
>A: the ball
>and B: The hexagons on the ball. 

A soccer ball is an icosadodecahedron, meaning that every vertex is
common for two hexagons and a pentagon. Simply wrapping a hexagon
pigment won't help. Actually it's impossible as hexagons pack the
plane completely and hence leave no space for 'folding'.


Peter Popov ICQ : 15002700
Personal e-mail : pet### [at] usanet
TAG      e-mail : pet### [at] tagpovrayorg


Post a reply to this message

From: David Fontaine
Subject: Re: Question on isosurfaces.
Date: 6 Aug 2000 18:02:03
Message: <398DDE68.18747833@faricy.net>
You cannot do this with a hexagon pigment; a soccer ball is a truncated
icosahedron (or icosadodecahedron as Peter said), meaning if you take an
icosahedron and chop off the points you will get a soccer ball. I'm not sure an
isosurface is your best bet; you could define individual hexagons/pentagons and
tile them.

CreeD wrote:

> Hi.  I'm looking to make a soccer ball-like object that combines
> two functions into one isosurface:
> A: the ball
> and B: The hexagons on the ball. I want these hexagons to be raised, which
> is why
> I'm using an isosurface and not a sphere with a function as a surface
> normal.
>
> In addition I'm trying to use random numbers to generate random hexagon
> colors
> on this ball.
>
> Can someone tell me what's wrong with this code?  I have several problems
> that have stumped me.
>
> 1. Both the hexagon pigment and the isosurface function"FHexagon" tend to
> create
> the hexagons asymmetrically, so that at the poles of my sphere there are
> hexagons,
> and these "extrude" downwards along the y axis to the opposite pole. I'd
> like
> hexagons all around the equator as well.

[snip]

--
David Fontaine     <dav### [at] faricynet>     ICQ 55354965
Please visit my website: http://www.faricy.net/~davidf/


Post a reply to this message

From: Tor Olav Kristensen
Subject: Re: Question on isosurfaces.
Date: 6 Aug 2000 19:51:46
Message: <398DF95B.18ACF8B9@online.no>
CreeD wrote:
> 
> Hi.  I'm looking to make a soccer ball-like object that combines
> two functions into one isosurface:
> A: the ball
> and B: The hexagons on the ball.
> 8< ... Snip ...

Others has already mentioned that you need hexagons 
and pentagons to make a "soccer ball".

In this posting  you'll find the 3D - co ordinates for 
the corners of these hexagons and pentagons:

news://news.povray.org/38E54FA5.98071D16%40hotmail.com

("Bumpy CSG-sphere" posted to povray.text.scene-files 
1. April -00)

I can explain further if you are interested.


There is a soccer ball -like image at my web page.

Tor Olav
--
mailto:tor### [at] hotmailcom
http://www.crosswinds.net/~tok/tokrays.html


Post a reply to this message

From: Warp
Subject: Re: Question on isosurfaces.
Date: 7 Aug 2000 06:24:47
Message: <398e8e6f@news.povray.org>
ryan constantine <rco### [at] yahoocom> wrote:
: to get hexagons to wrap around a sphere, i think you need megapov's uv
: mapping.

  Isosurfaces don't have support for uv-mapping.

-- 
main(i,_){for(_?--i,main(i+2,"FhhQHFIJD|FQTITFN]zRFHhhTBFHhhTBFysdB"[i]
):_;i&&_>1;printf("%s",_-70?_&1?"[]":" ":(_=0,"\n")),_/=2);} /*- Warp -*/


Post a reply to this message

From: ryan constantine
Subject: Re: Question on isosurfaces.
Date: 10 Aug 2000 04:36:06
Message: <399268D6.329D627F@yahoo.com>
thanks for the tip.

Warp wrote:
> 
> ryan constantine <rco### [at] yahoocom> wrote:
> : to get hexagons to wrap around a sphere, i think you need megapov's uv
> : mapping.
> 
>   Isosurfaces don't have support for uv-mapping.
> 
> --
> main(i,_){for(_?--i,main(i+2,"FhhQHFIJD|FQTITFN]zRFHhhTBFHhhTBFysdB"[i]
> ):_;i&&_>1;printf("%s",_-70?_&1?"[]":" ":(_=0,"\n")),_/=2);} /*- Warp -*/


Post a reply to this message

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