POV-Ray : Newsgroups : povray.newusers : Problem with colliding elements Server Time
29 Jul 2024 14:17:00 EDT (-0400)
  Problem with colliding elements (Message 1 to 5 of 5)  
From: Numb-C
Subject: Problem with colliding elements
Date: 9 Aug 2005 07:20:00
Message: <web.42f89130212c59aa726bd13c0@news.povray.org>
Hi all,

I just started with POV-Ray yesterday and created the code as seen on te
bottom of this message.

It creates 9 superellipsoid's with various heights.
I see two problems here and would like to know if these are bugs or
something I can easily resolve.

1) If the sides of the superellipsoid's collide with other elements I see
these flat parts probably indicating the curve of the superellipsoid's. But
I wanted them to just stay orange.

2) If the sides of the superellipsoid's collide with each other (or even if
you out them inside each other) you get those nasty black areas.

Note: I did not get this second effect when I used random colors for the
superellipsoid's.

Anyone care to comment on this and enlighten me ?

Code:

camera
{
 location <-4, 4, -4>
 look_at <4, 0, 4>
 up <0, .9, 0>
 right <1.6, 0, 0>
}

light_source
{
 <-75, 120, -25>
 rgb 1
}

plane
{
 y, 0
 pigment
 {
  checker
  rgb 1
  rgb <.9, .9, .9>
 }
}

plane
{
 x, 10
 pigment
 {
  rgb 1
 }
}

plane
{
 z, 10
 pigment
 {
  rgb 1
 }
}

#declare randomSeed = seed (2005);

#declare roundedBox =
 superellipsoid
 {
  <0.2, 0.2>
  pigment
  {
   rgb <1, .9, .8, .99>
  }
  finish
  {
   ambient 0.15
   diffuse 0.85
   phong 1
  }
  translate <0, 1.001, 0>
 };

#declare xCount = 0;
#declare zCount = 0;

#while (xCount < 3)
 #while (zCount < 3)
  object
  {
   roundedBox
   translate <xCount * 2.0001, 0, zCount * 2.0001>
   scale <1, rand(randomSeed) * 2, 1>
   pigment
   {
    rgb <1, .9, .8, .99>
   }
  }
     #declare zCount = zCount + 1;
 #end
 #declare zCount = 0;
 #declare xCount = xCount + 1;
#end


Post a reply to this message

From: Mike Williams
Subject: Re: Problem with colliding elements
Date: 9 Aug 2005 07:59:04
Message: <p+uJwGA$pJ+CFw1m@econym.demon.co.uk>
Wasn't it Numb-C who wrote:
>Hi all,
>
>I just started with POV-Ray yesterday and created the code as seen on te
>bottom of this message.
>
>It creates 9 superellipsoid's with various heights.
>I see two problems here and would like to know if these are bugs or
>something I can easily resolve.
>
>1) If the sides of the superellipsoid's collide with other elements I see
>these flat parts probably indicating the curve of the superellipsoid's. But
>I wanted them to just stay orange.
>
>2) If the sides of the superellipsoid's collide with each other (or even if
>you out them inside each other) you get those nasty black areas.
>
>Note: I did not get this second effect when I used random colors for the
>superellipsoid's.
>
>Anyone care to comment on this and enlighten me ?
>

(1)All the colour in a POV object is at the surface. When part of the
surface goes below the floor, you lose the contribution from its colour.

One way to work round this is to chop off the bottom of the rounded box
just above the floor, like this:

#while (xCount < 3)
 #while (zCount < 3)
  intersection {
   object
    {roundedBox
      translate <xCount * 2.0001, 0, zCount * 2.0001>
      scale <1, rand(randomSeed) * 2, 1>
     }
    plane {-y,-0.001}
    
    pigment {rgbf <1, .9, .8, .99> }
    finish {ambient 0.15 diffuse 0.85 phong 1}
  }
  #declare zCount = zCount + 1;
 #end
 #declare zCount = 0;
 #declare xCount = xCount + 1;
#end


(2)The nasty black areas are points where you've reached the current
max_trace_level.

For efficiency, POV doesn't usually trace rays further than 5
intersections because it can take a long time and usually the
contribution from points further than that are negligible. I guess that
your random colours had generally lower transparency so you can't see
through the 5 layers.

Try adding
        global_settings {max_trace_level 20}


-- 
Mike Williams
Gentleman of Leisure


Post a reply to this message

From: St 
Subject: Re: Problem with colliding elements
Date: 9 Aug 2005 08:22:47
Message: <42f8a017@news.povray.org>
"Numb-C" <ann### [at] philipscom> wrote in message 
news:web.42f89130212c59aa726bd13c0@news.povray.org...
> Hi all,

  Hi

  Just add this before your camera:

  global_settings {
   max_trace_level 50  }


   ~Steve~


Post a reply to this message

From: St 
Subject: Re: Problem with colliding elements
Date: 9 Aug 2005 08:24:23
Message: <42f8a077@news.povray.org>
"St." <dot### [at] dotcom> wrote in message news:42f8a017@news.povray.org...

    ...and Mike explained it well.  ;)

    ~Steve~


Post a reply to this message

From: Numb-C
Subject: Re: Problem with colliding elements
Date: 9 Aug 2005 08:40:00
Message: <web.42f8a353d70a9d8e726bd13c0@news.povray.org>
Thanks both for your quick and clear explanations. I will try this out as
soon as I get home later today.


Post a reply to this message

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