![](/i/fill.gif) |
![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
"Mr. Art" wrote:
> Yes.
How Mr Art.
Pabs
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
This short bit of code shows how to use a
planetary image as a displacement map on a sphere.
I had set it up as a macro to work with different
planet displacement maps, planet pigment maps, planet sizes,
and percentage displacements.
I know that this is displacement mapping only on a
sphere, but the same concept should work on other shapes.
I hope that this helps.
#macro PlanetMac(Pic1,Pic2,Rad,Prec)
#local Pic= function{pigment {image_map {png Pic1 interpolate 2
map_type 1}}}
#local R0=Rad;
#local FUNC1=function {"sphere",<R0>}
isosurface
{
function{FUNC1(x,y,z)-(Pic(x,y,z)*R0*Prec)}
contained_by {sphere {0,R0*(1+Prec)}}
method 2 max_gradient 10
pigment {image_map{png Pic2 interpolate 2 map_type 1}}
finish { blinn 1 facets .2 reflection 1 reflect_metallic
conserve_energy}
interior{ior 20}
}
#end
Pabs wrote:
>
> "Mr. Art" wrote:
>
> > Yes.
>
> How Mr Art.
>
> Pabs
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
"Mr. Art" wrote:
> This short bit of code shows how to use a
> planetary image as a displacement map on a sphere.
> I know that this is displacement mapping only on a
> sphere, but the same concept should work on other shapes.
> I hope that this helps.
I was thinking more along the lines of a patch which used isosurfaces to
implement displacement mapping
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
From: Mark Wagner
Subject: Re: Displacement mapping using isosurfaces
Date: 12 Apr 2000 01:09:58
Message: <38f40526@news.povray.org>
|
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
Pabs wrote in message <38F3D600.A087CAF2@hotmail.com>...
>"Mr. Art" wrote:
>
>> This short bit of code shows how to use a
>> planetary image as a displacement map on a sphere.
>> I know that this is displacement mapping only on a
>> sphere, but the same concept should work on other shapes.
>> I hope that this helps.
>
>I was thinking more along the lines of a patch which used isosurfaces to
>implement displacement mapping
How about the following code:
#declare AnObject = union{
sphere{<0,0,0>,1}
torus{1.3,0.5}
}
#declare AnObjectFunc = pigment{
object{
AnObject
}
color rgb 0, color rgb 1
}
isosurface{
function{AnObjectFunc+noise3d(x,y,z)}
contained_by{box{min_extent(AnObject),max_extent(AnObject)}
method 2
max_gradient 100
pigment{rgb 1}
}
I can't guarentee that this will work on the first try, but it will displace
the surface of any object using the noise3d function. To use a different
object, just replace AnObject with the object you want.
Mark
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
The syntax is all wrong for AnObjectFunc.
Mark Wagner wrote:
> How about the following code:
>
> #declare AnObject = union{sphere{<0,0,0>,1}torus{1.3,0.5}}
>
> #declare AnObjectFunc = pigment{object{AnObject} color rgb 0, color rgb 1}
>
> isosurface{
> function{AnObjectFunc+noise3d(x,y,z)}
> contained_by{box{min_extent(AnObject),max_extent(AnObject)}
> method 2
> max_gradient 100
> pigment{rgb 1}
> }
>
> I can't guarentee that this will work on the first try, but it will displace
> the surface of any object using the noise3d function. To use a different
> object, just replace AnObject with the object you want.
>
> Mark
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
> #declare AnObjectFunc = pigment{
> object{
> AnObject
> }
> color rgb 0, color rgb 1
> }
Are you sure this works - I don't think it will unless you are thinking about
the proximity pigment func
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
In article <38f40526@news.povray.org>, "Mark Wagner"
<mar### [at] gte net> wrote:
> I can't guarentee that this will work on the first try, but it will
> displace
> the surface of any object using the noise3d function. To use a different
> object, just replace AnObject with the object you want.
I think you mean:
#declare AnObject = union {
sphere {<0,0,0>, 1}
torus {1.3, 0.5}
}
#declare AnObjectFunc =
function {
pigment {
object {AnObject color rgb 0, color rgb 1}
}
}
isosurface {
function {AnObjectFunc(x,y,z)
+noise3d(x,y,z)
}
method 2
max_gradient 100
contained_by {box {min_extent(AnObject),max_extent(AnObject)}}
pigment {color rgb <1,1,1>}
}
And the object pattern turns out to not be very good for
isosurfaces...it has two values separated by a sharp boundary, sort of
an infinite amount of slope. A boundary can appear anywhere, so the
isosurface algorithm has trouble finding them. And I don't think you
could displace the surfaces from within the function... I have a pattern
blurring feature I have been thinking of which might reduce this
problem, but I am not sure...
The proximity pattern might be helpful for this, but it is slow. You
might want to make a script that uses eval_pattern() to write the
results of proximity to a 3D density file, and use that in the
isosurface.
If your object is a blob, the blob pattern is useful. I have used it
before with very good results.
Also, don't forget that when the function goes through a pigment, you
can use warps like turbulence, black holes, etc to displace it. And with
function patterns and pigment functions, you can put any function
through a pigment. :-)
--
Christopher James Huff - Personal e-mail: chr### [at] yahoo com
TAG(Technical Assistance Group) e-mail: chr### [at] tag povray org
Personal Web page: http://chrishuff.dhs.org/
TAG Web page: http://tag.povray.org/
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
> I was thinking more along the lines of a patch which used isosurfaces to
> implement displacement mapping
I was thinking about it & came up with the attached image
This is explained as follows
1 the ray is traced to the surface normally
2 from the point of intersection take a point d (the displacement value for
that poin in space) units along the normal for that point of intersection
this is the center of a 5*5 rectangle of points used to make a bicubic
surface (or something like that)
3 the other points are found by tracing back to the surface and then going
up the normals
4 the ray is reflected off the bicubic surface
There are a lot of problems with this but it is a start
1 It will be slow (as slow/slower as/than proximity pigment??)
2 at small angles of intersection the ray may go under the surface and miss
it
maybe the points could be got by shooting from a point along the ray instead
3 when he ray doesn't hit the original surface (but it should hit the
displaced surface) this means that edges of an object will be smooth as the
original object - maybe we could use a proximity function added to a
displacement function and convert it to an isosurface... or we could just
tesselate the whole primitive into bicubic patches...
Post a reply to this message
Attachments:
Download 'temp.gif' (4 KB)
Preview of image 'temp.gif'
![temp.gif](/povray.unofficial.patches/attachment/%3C38F685AA.158F04D9%40hotmail.com%3E/temp.gif?preview=1)
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
On Fri, 14 Apr 2000 10:42:50 +0800 Pabs <pab### [at] hotmail com> wrote:
>I was thinking about it & came up with the attached image
Hi, Pabs. Please post images in .binaries groups. For further
clarification please read "Where can I post my binary or text file?" in
the povray.announce.frequently-asked-questions group. Thanks for your
participation.
--
Alan - ako### [at] povray org - a k o n g <at> p o v r a y <dot> o r g
http://www.povray.org - Home of the Persistence of Vision Ray Tracer
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
Pabs <pab### [at] hotmail com> writes:
> Any chance of this being possible
Perhaps you should have a look at my attempt. The image (including source)
is in my image gallery:
http://www.fmi.uni-konstanz.de/~willhalm/graphics/tracegallery/
I hope this helps.
Thomas
--
http://thomas.willhalm.de/ (includes pgp key)
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |