![](/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) |
between the following two pov-codes' results.
I have no idea, hope someone can tell me why two identical objects look
different
one is a simple CSG, the other an isosurface
attached are the results...
///////////Code A start/////////////
#version unofficial MegaPov 0.6
isosurface {
function {
if(1 - x,0,1)+
if(1 - y,0,1)+
if(1 - z,0,1)+
if(x + 1,0,1)+
if(y + 1,0,1)+
if(z + 1,0,1)
}
threshold 0.5
contained_by { box {<-10,-10,-10>,<10,10,10>}}
pigment {rgb 1}
}
light_source {<10,14,24> rgb 1}
camera {
location 3
look_at 0
}
//////////code B start//////////////
intersection {
plane {<1,0,0> , 1}
plane {<0,1,0> , 1}
plane {<0,0,1> , 1}
plane {-<1,0,0> , 1}
plane {-<0,1,0> , 1}
plane {-<0,0,1> , 1}
pigment {rgb 1}
}
light_source {<10,14,24> rgb 1}
camera {
location 3
look_at 0
}
////////END//////////////////
Post a reply to this message
Attachments:
Download 'CornerIsoFree.jpg' (4 KB)
Download 'CornerIso.jpg' (4 KB)
Preview of image 'CornerIsoFree.jpg'
![CornerIsoFree.jpg](/povray.binaries.images/attachment/%3C39f0dc85%40news.povray.org%3E/CornerIsoFree.jpg?ttop=443840&toff=11750&preview=1)
Preview of image 'CornerIso.jpg'
![CornerIso.jpg](/povray.binaries.images/attachment/%3C39f0dc85%40news.povray.org%3E/CornerIso.jpg?ttop=443840&toff=11750&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) |
Wasn't it Oded who wrote:
>between the following two pov-codes' results.
>I have no idea, hope someone can tell me why two identical objects look
>different
>one is a simple CSG, the other an isosurface
>attached are the results...
I don't fully understand why the two objects look different, but I can
tell you that it's the isosurface that's wrong, and I can tell you what
you can do to fix it.
But you may not like the solution.
Method 1 isosurfaces sometimes have problems when the function has an
extremely high gradient, so you can fix it by using method 2, i.e. be
adding either
method 2
eval
or, in this particular case,
method 2
max_gradient 4000
The reason that you may not like the solution is that it now takes a
ridiculously long time to render the image.
Note that, for this function, the max_gradient is dependent on the
accuracy. The gradient is really infinite at the surface of the object
because the value of "if(1 - x,0,1)" changes from 0 to 1 over an
arbitrarily small distance. The smallest distance that gets considered
depends on the accuracy setting.
An alternative solution would be to generate the isosurface box from a
function that has less steep gradients, such as
isosurface {
function { (y*y-0.5) & (x*x-0.5) & (z*z-0.5) }
threshold 0.5
contained_by {box <-2,-2,-2><2,2,2>}
pigment {rgb 1}
}
Which is correct whether you use method 1 or method 2, and renders
quickly if you use method 1 or if you make the bounding box a reasonable
size.
--
Mike Williams
Gentleman of Leisure
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) |
Oded wrote:
>
> between the following two pov-codes' results.
> I have no idea, hope someone can tell me why two identical objects look
> different
> one is a simple CSG, the other an isosurface
> attached are the results...
>
As Mike said, the isosurface function you used is not that good because of the
high gradient (abrupt changes in value) occuring. In general the if(,,)
construct is not very suited for isosurface functions in most cases.
You should use the classical isosurface cube instead:
isosurface{
function { abs(x) & abs(y) & abs(z) }
threshold 0.5
contained_by{ box { <-2,-2,-2> <2,2,2> } }
}
Christoph
--
Christoph Hormann <chr### [at] gmx de>
Homepage: http://www.schunter.etc.tu-bs.de/~chris/
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) |
thanks, both of you
got it now.
since im not gonna make a box, its just an example of a more general
problem.
i have a question , what does the '&' operator do (not logically, i mean
actually, since you dont have true/false nor bits in real numbers....)?
Christoph Hormann <Chr### [at] schunter etc tu-bs de> wrote in message
news:39F13E71.63853111@schunter.etc.tu-bs.de...
>
>
> Oded wrote:
> >
> > between the following two pov-codes' results.
> > I have no idea, hope someone can tell me why two identical objects look
> > different
> > one is a simple CSG, the other an isosurface
> > attached are the results...
> >
>
> As Mike said, the isosurface function you used is not that good because of
the
> high gradient (abrupt changes in value) occuring. In general the if(,,)
> construct is not very suited for isosurface functions in most cases.
>
> You should use the classical isosurface cube instead:
>
>
> function { abs(x) & abs(y) & abs(z) }
> threshold 0.5
> contained_by{ box { <-2,-2,-2> <2,2,2> } }
> }
>
> Christoph
>
> --
> Christoph Hormann <chr### [at] gmx de>
> Homepage: http://www.schunter.etc.tu-bs.de/~chris/
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) |
Oded wrote:
>
[...]
> i have a question , what does the '&' operator do (not logically, i mean
> actually, since you dont have true/false nor bits in real numbers....)?
>
Have a look at part 3 of Samuel T.'s isosurface tutorial:
http://www.hamiltonite.pwp.blueyonder.co.uk/raytracing/STBenge/iso_tutorial3.html
Christoph
--
Christoph Hormann <chr### [at] gmx de>
Homepage: http://www.schunter.etc.tu-bs.de/~chris/
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) |