POV-Ray : Newsgroups : povray.advanced-users : Formula to add pigment image map to isosurface sphere ? Server Time
30 Jul 2024 08:17:50 EDT (-0400)
  Formula to add pigment image map to isosurface sphere ? (Message 1 to 7 of 7)  
From: Gilles Tran
Subject: Formula to add pigment image map to isosurface sphere ?
Date: 5 Feb 2000 07:56:38
Message: <389C1E1F.951FB4B6@inapg.inra.fr>
This formula was posted in one of the groups not so long ago (a couple
of weeks ?).
It was meant to make planets out of planet maps, if I remember well.
The map was used as a pigment map, turned into a function added to the
regular sphere function :
x*x+y*y+z*z + stuff here (hfld())

with hfld=function{pigment{image_mape{tga "mymap"}}}

The nice thing was that the height field coordinates were mapped to the
sphere (or so I guessed by looking at the code). So it was not
x*x+y*y+z*z +1-hfld(x,y,z) but something slightly more complicated.

I can't find it, and I don't remember the author's name... I could be
mistaken too.
Any help very much appreciated !

G.


Post a reply to this message

From: mr art
Subject: Re: Formula to add pigment image map to isosurface sphere ?
Date: 5 Feb 2000 09:05:51
Message: <389C2E4C.25A2B350@gci.net>
This is how I do it:
#declare Pic=function{pigment{image_mape{tga "mymap"}}}
#declare FUNC1=function {"sphere",<R0>}
#declare RO = //Radius of planet
#declare Prec = // % difference that the image map
		// makes to the surface of the sphere
isosurface
	{
	function{FUNC1(x,y,z)-(Pic(x,y,z)*R0*Prec)}
	contained_by {sphere {0,R0*(1+Prec)}}
	...
	}
Seems to work well.

Gilles Tran wrote:
> 
> This formula was posted in one of the groups not so long ago (a couple
> of weeks ?).
> It was meant to make planets out of planet maps, if I remember well.
> The map was used as a pigment map, turned into a function added to the
> regular sphere function :
> x*x+y*y+z*z + stuff here (hfld())
> 
> with hfld=function{pigment{image_mape{tga "mymap"}}}
> 
> The nice thing was that the height field coordinates were mapped to the
> sphere (or so I guessed by looking at the code). So it was not
> x*x+y*y+z*z +1-hfld(x,y,z) but something slightly more complicated.
> 
> I can't find it, and I don't remember the author's name... I could be
> mistaken too.
> Any help very much appreciated !
> 
> G.

-- 
Mr. Art

"Often the appearance of reality is more important 
than the reality of the appearance."
Bill DeWitt 2000


Post a reply to this message

From: Gilles Tran
Subject: Re: Formula to add pigment image map to isosurface sphere ?
Date: 5 Feb 2000 15:12:10
Message: <389C8433.8D799243@inapg.inra.fr>
"mr.art" wrote:

> This is how I do it:

The formula rings a bell. It may not be what I expected (I was looking for
something that would actually map the image around the sphere) but it is
probably what I had seen before. And yes it works fine enough for my current
project.

Thanks a lot.
G.


Post a reply to this message

From: David Fontaine
Subject: Re: Formula to add pigment image map to isosurface sphere ?
Date: 5 Feb 2000 16:46:38
Message: <389C99FF.5FD07069@faricy.net>
To map to a sphere:

#declare foo=function{...}
...
function {
   foo(atan2(x,z)/pi,atan2(y,sqrt(x^2+z^2))/(.5*pi),sqrt(x^2+y^2+z^2))
}
...

X goes around the equator from -1 to 1
Y goes from southern pole to northern pole from -1 to 1
Z goes outward from center from 0 to infinite

--
Homepage: http://www.faricy.net/~davidf/
___     ______________________________
 | \     |_       <dav### [at] faricynet>
 |_/avid |ontaine      <ICQ 55354965>


Post a reply to this message

From: Chris Huff
Subject: Re: Formula to add pigment image map to isosurface sphere ?
Date: 5 Feb 2000 17:42:41
Message: <chrishuff_99-CD4212.17433605022000@news.povray.org>
In article <389C8433.8D799243@inapg.inra.fr>, Gilles Tran 
<tra### [at] inapginrafr> wrote:

> The formula rings a bell. It may not be what I expected (I was 
> looking for something that would actually map the image around the 
> sphere) but it is probably what I had seen before. And yes it works 
> fine enough for my current project.

Wouldn't the mapping types built into image_map be enough? Or the 
mapping warps?

-- 
Chris Huff
e-mail: chr### [at] yahoocom
Web page: http://chrishuff.dhs.org/


Post a reply to this message

From: mr art
Subject: Re: Formula to add pigment image map to isosurface sphere ?
Date: 5 Feb 2000 21:50:46
Message: <389CE198.989A8153@gci.net>
This does map the image to the sphere, as a displacement.
I have used the pigment{image_map{ png "*.png" map_type 1}}
statement for the pigment. See the thread "My first MegaPOV0.4 image(26k
bu)"
for an example. I have set this up as a macro to be used with
various planet images.

Gilles Tran wrote:
> 
> "mr.art" wrote:
> 
> > This is how I do it:
> 
> The formula rings a bell. It may not be what I expected (I was looking for
> something that would actually map the image around the sphere) but it is
> probably what I had seen before. And yes it works fine enough for my current
> project.
> 
> Thanks a lot.
> G.

-- 
Mr. Art

"Often the appearance of reality is more important 
than the reality of the appearance."
Bill DeWitt 2000


Post a reply to this message

From: Gilles Tran
Subject: Re: Formula to add pigment image map to isosurface sphere ?
Date: 7 Feb 2000 04:07:26
Message: <389E8B6C.FF02553E@inapg.inra.fr>
Chris Huff wrote:

> Wouldn't the mapping types built into image_map be enough? Or the
> mapping warps?

They do work perfectly.
Stupid me just realized this this week-end after writing my answer to Mr
Art.
G.


Post a reply to this message

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