POV-Ray : Newsgroups : povray.binaries.images : isofunction problem (~10kbbu) Server Time
1 Oct 2024 05:17:35 EDT (-0400)
  isofunction problem (~10kbbu) (Message 1 to 3 of 3)  
From: Richard Dault
Subject: isofunction problem (~10kbbu)
Date: 6 Sep 2000 11:21:32
Message: <39b660fc$1@news.povray.org>
Okay, here is the problem I was referring to in my last post.  I have an
iso-sphere which I intersected with an iso-y plane.  So this should give me
a half sphere right?  Well, it does, as long as I keep it at the origin.  As
soon as I translate it away from the origin, I get a strange result.

In the first picture of the three spheres, they should be identical, but
they are not.  Only the green one has the expected result.  Notice something
else that is really strange?  Look at the shadow of the middle sphere.  The
light source is directly above it in the x-direction, but yet the shadow is
of a complete sphere?!?

The second image shows only the middle sphere but moved over by 1 unit.

Anyone know why this is happening?

The code is as follows:

#include "colors.inc"
#version unofficial MegaPov 0.5;

camera { location <0,1,-10> look_at <0,0,0> }
light_source { <0,50,-15> color White }

plane { y 0 pigment { color White } translate y-4 }

#declare ball = function { x*x + y*y + z*z - 2*2 }

#declare broken =
isosurface {
  function {
    ball(x,y,z) & y
  }
  max_trace 5
  method 2
  accuracy 0.001
  threshold 0
  max_gradient 4.5
  contained_by { sphere { 0 2.3 } }
}

#declare half =
difference {
  sphere { 0 1.8 }
  object { broken }
}

object { half rotate z*90 translate x*-4 pigment { color Blue } }
object { half rotate z*90 translate x*0 pigment { color Green } }
object { half rotate z*90 translate x*4 pigment { color Yellow } }


Post a reply to this message


Attachments:
Download 'isobug1.jpg' (7 KB) Download 'isobug2.jpg' (5 KB)

Preview of image 'isobug1.jpg'
isobug1.jpg

Preview of image 'isobug2.jpg'
isobug2.jpg


 

From: Jérôme Berger
Subject: Re: isofunction problem (~10kbbu)
Date: 6 Sep 2000 11:44:01
Message: <39B66640.A7BC1560@enst.fr>
Richard Dault wrote:
> 
> Okay, here is the problem I was referring to in my last post.  I have an
> iso-sphere which I intersected with an iso-y plane.  So this should give me
> a half sphere right?  Well, it does, as long as I keep it at the origin.  As
> soon as I translate it away from the origin, I get a strange result.
> 
> In the first picture of the three spheres, they should be identical, but
> they are not.  Only the green one has the expected result.  Notice something
> else that is really strange?  Look at the shadow of the middle sphere.  The
> light source is directly above it in the x-direction, but yet the shadow is
> of a complete sphere?!?
> 
> The second image shows only the middle sphere but moved over by 1 unit.
> 
> Anyone know why this is happening?
> 
> The code is as follows:
> 
<snip>
> #declare broken =
> isosurface {
>   function {
>     ball(x,y,z) & y
>   }
<snip>

	Why do you intersect your plane with a sphere? Does the problem still
occur if your function is simply 'y'? (nonetheless, I don't think there
should be a problem with your scene so I think it's a bug...)


-- 

* Doctor Jekyll had something * mailto:ber### [at] inamecom
* to Hyde...                  * http://www.enst.fr/~jberger
*******************************


Post a reply to this message

From: Mike Williams
Subject: Re: isofunction problem (~10kbbu)
Date: 7 Sep 2000 16:55:19
Message: <Bvr7GDAcN9t5EwH$@econym.demon.co.uk>
Wasn't it Richard Dault who wrote:
>Okay, here is the problem I was referring to in my last post.  I have an
>iso-sphere which I intersected with an iso-y plane.  So this should give me
>a half sphere right?  Well, it does, as long as I keep it at the origin.  As
>soon as I translate it away from the origin, I get a strange result.
>
>In the first picture of the three spheres, they should be identical, but
>they are not.  Only the green one has the expected result.  Notice something
>else that is really strange?  Look at the shadow of the middle sphere.  The
>light source is directly above it in the x-direction, but yet the shadow is
>of a complete sphere?!?
>
>The second image shows only the middle sphere but moved over by 1 unit.
>
>Anyone know why this is happening?
>

It does appear to be a bug. You can get a clearer idea of what is
happening if you add a line like

  sphere {0,2.3 pigment {rgbf <1,.5,.5,1>}}

This is a semitransparent copy of where the contained_by sphere would be
before the translation. Once you can see the unstranslated contained_by
sphere, it becomes clear (particularly in the second image) that the
parts of the isosurface outside the untranslated contained_by sphere are
missing.

It seems that the isosurface function obeys the translate x*1, but its
contained_by sphere gets left behind.

If you just take an isosurface object and translate it, then it takes
its contained_by sphere with it (e.g. object {broken rotate z*90
translate x*-1 pigment {rgb 1}} works as expected) and so do CSG unions,
but CSG differences and intersections leave the contained_by sphere
behind.


-- 
Mike Williams
Gentleman of Leisure


Post a reply to this message

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