POV-Ray : Newsgroups : povray.newusers : Help with CGS Server Time
5 Nov 2024 20:15:33 EST (-0500)
  Help with CGS (Message 1 to 10 of 14)  
Goto Latest 10 Messages Next 4 Messages >>>
From: Kevork Abadjian
Subject: Help with CGS
Date: 15 Apr 1999 17:05:21
Message: <3716462F.2BA61601@conted.lan.mcgill.ca>
Hi.

I have just started using pov and I do not have any prior experience
with other similar products.

I tried to follow the documentation and create a simple image of five
glass balls overlapping in a "merge" statement according to what I read
in the docs it should have rendered one solid object made of all the
balls, but no matter what I do I still see the overlapping boundaries.
I have tried it with/without AA. Ihave tried it with official pov and
with uvpov.  I have rased and dropped the intensity of the lights.  and
cannot make them go away.

I would appreciate it if someone could make me solve this, or understand
it.


Post a reply to this message

From: h redway
Subject: Re: Help with CGS
Date: 15 Apr 1999 19:04:01
Message: <37166261.541787A2@which.net>
Kevork,

It's very hard to figure whats going on without knowing exactly what you've
done. Give us a hand here and include your code in a reply to this message.

        Graham.

Kevork Abadjian wrote:

> Hi.
>
> I have just started using pov and I do not have any prior experience
> with other similar products.
>
> I tried to follow the documentation and create a simple image of five
> glass balls overlapping in a "merge" statement according to what I read
> in the docs it should have rendered one solid object made of all the
> balls, but no matter what I do I still see the overlapping boundaries.
> I have tried it with/without AA. Ihave tried it with official pov and
> with uvpov.  I have rased and dropped the intensity of the lights.  and
> cannot make them go away.
>
> I would appreciate it if someone could make me solve this, or understand
> it.


Post a reply to this message

From: Ken
Subject: Re: Help with CGS
Date: 15 Apr 1999 22:23:42
Message: <37168FE5.F200E44B@pacbell.net>
Kevork Abadjian wrote:
> 
> Hi.
> 
> I have just started using pov and I do not have any prior experience
> with other similar products.
> 
> I tried to follow the documentation and create a simple image of five
> glass balls overlapping in a "merge" statement according to what I read
> in the docs it should have rendered one solid object made of all the
> balls, but no matter what I do I still see the overlapping boundaries.
> I have tried it with/without AA. Ihave tried it with official pov and
> with uvpov.  I have rased and dropped the intensity of the lights.  and
> cannot make them go away.
> 
> I would appreciate it if someone could make me solve this, or understand
> it.

  What you are probably seeing is correct behaivior for the function.
Merge will not make the interior surfaces dissapear per se. What will
instead happen is that you will have no two areas overlapping. Think
of like this. If your spheres were flat and arranged in a pie shape.
You then divide the pie up into equal sections like cutting it with a
knife. What you will see is the dividing line where each sphere's
surface now forms an internal divider with no overlapping of materials.
It doesn't remove these internal dividers but actually creates them for
you. A simple way to test this would be to make six spheres. Arrange them
roughly in a circle larger than the circumference of the sheres you use.
Make every other sphere clear ( rgbf 0 ) and then assign a different
color to the other three spheres. You will now see when rendered that
where the color spheres over lap the clear spheres that a straight boundry
line is formed instead of the additive of the color and the clear in that
area where they overlap. To remove the boundry line takes a bit more work
than just using a merge CSG function.

-- 
Ken Tyler

mailto://tylereng@pacbell.net


Post a reply to this message

From: Kevork Abadjian
Subject: Re: Help with CGS
Date: 16 Apr 1999 01:49:04
Message: <3716C2D6.F903CEE0@conted.lan.mcgill.ca>
I was looking at the two replies posted to my message and as far as I can see
Ken explained the situation even better than I could; but he stopped just short
of a suggestion to fix the problem.

there is nothing special about the source, I am using the std seen file and
just and std texture for glass and a switch to toggle on an off the photones.

here is the source:


// Persistence of Vision Ray Tracer Scene Description File
// File: ?.pov
// Vers: 3.1
// Desc: Basic Scene Example
// Date: mm/dd/yy
// Auth: ?[esp]
//

#version 3.1

#include "colors.inc"
#include "glass.inc"

#declare phd=1.0;  // lower this value for a higher density (better
                   //   quality render)

#declare phon=0;  //turn pgotons off or on (0/1)

global_settings
{
  assumed_gamma 1.0
  max_trace_level 20
  #if (phon)
    photons{
    gather 20,100
    radius 0.1*phd, 2, 0.1*phd
    autostop 0
  }
  #end

}

// ----------------------------------------
camera
{
  location  <0.0, 0.5, -4.0>
  direction 1.5*z
  right     4/3*x
  look_at   <0.0, 0.0,  0.0>
}

//sky_sphere
//{
//  pigment
// {
//    gradient y
//    color_map { [0.0 color blue 0.6] [1.0 color rgb 1] }
//  }
//}

light_source
{
  0*x // light's position (translated below)
  color red 1.0  green 1.0  blue 1.0  // light's color
  translate <-30, 30, -30>
}

// ----------------------------------------
plane { y, -1 pigment {color rgb <0.7,0.5,0.3>}}


#declare ball = sphere
      {<-.7,-0.3,0>, 0.4
         texture {T_Glass3}
         interior{ior 1.5}
           #if (phon)
           photons{
                   density 0.01*phd
                   reflection on
                   refraction on
                  }
           #end

       }

#declare cnt=0

#while (cnt < 5)
       merge {
       object {ball
               translate <cnt/2.5,0,0>
              }
       #declare cnt=cnt+1
       }
#end


Post a reply to this message

From: Ken
Subject: Re: Help with CGS
Date: 16 Apr 1999 04:14:18
Message: <3716E1F0.706FC63A@pacbell.net>
Kevork Abadjian wrote:
> 
> I was looking at the two replies posted to my message and as far as I can see
> Ken explained the situation even better than I could; but he stopped just short
> of a suggestion to fix the problem.
> 
> there is nothing special about the source, I am using the std seen file and
> just and std texture for glass and a switch to toggle on an off the photones.

  Your misunderstanding about how the merge function is supposed to behave
is not to do with the results you are witnessing from the example you are
using but instead of the way you are using a CSG operation inside of a
while loop. The correct way to implement a merge using a csg is like the
example below. It is your while loop rearranged to operate correctly.
When using a CSG within a while loop you must move the merge statement
outside the while statement or it is not acted upon correctly. Don't
ask me why this is so but I found after many hair pulling sessions and
then finaly by asking in these groups how to solve my problem. So without
further ado...


// This should now act correctly for a merge csg operation:
 #declare cnt=0
        merge { 
 #while (cnt < 5)
        object {ball
                translate <cnt/2.5,0,0>
               }
        #declare cnt=cnt+1
 #end 
}



-- 
Ken Tyler

mailto://tylereng@pacbell.net


Post a reply to this message

From: Phil Clute
Subject: Re: Help with CGS
Date: 16 Apr 1999 04:29:36
Message: <3716E849.3493316D@tiac.net>
Well, now I'm a bit confused too...
what am I doing wrong?

MERGE from the docs:
"The union operation just glues objects together, it does not remove the
objects' surfaces inside the union. Under most circumstances this
doesn't matter. However if a transparent union is used, those interior
surfaces will be visible. The merge operations can be used to avoid this
problem. It works just like union but it eliminates the inner
surfaces..."<snip>

I changed the code a little. I dropped the texture to use a pigment that
changes
color from sphere to sphere with a .7 transmit in order to show that
merge did
NOT as the docs say "eliminates the inner surfaces".

Heres my change:
#declare cnt=0;
#while (cnt < 5)
     merge {
          sphere{<-.7,-0.3,0>, 0.4
          translate <cnt/2.5,0,0>
          }
          pigment{rgbt<cnt*0.05,cnt/4.5,0.5,0.7>}//texture {T_Glass3}
          //interior{ior 1.5}
          #if (phon)
               photons{
                   density 0.01*phd
                   reflection on
                   refraction on
               }
          #end
          //rotate y*50        //I was checking to see if it was just an
effect of a bad angle
     }
#declare cnt=cnt+1
#end
------------------------------------------------------------------------

I'll post my render of this in povray.images under "Help with CGS"

--
...coffee?...yes please! extra sugar,extra cream...Thank you.


Post a reply to this message

From: Ken
Subject: Re: Help with CGS
Date: 16 Apr 1999 04:32:59
Message: <3716E652.446B9B61@pacbell.net>
Phil Clute wrote:
> 
> Well, now I'm a bit confused too...
> what am I doing wrong?
> 
> MERGE from the docs:
> "The union operation just glues objects together, it does not remove the
> objects' surfaces inside the union. Under most circumstances this
> doesn't matter. However if a transparent union is used, those interior
> surfaces will be visible. The merge operations can be used to avoid this
> problem. It works just like union but it eliminates the inner
> surfaces..."<snip>
> 
> I changed the code a little. I dropped the texture to use a pigment that
> changes
> color from sphere to sphere with a .7 transmit in order to show that
> merge did
> NOT as the docs say "eliminates the inner surfaces".

Your code suffers the same as his in that the merge needs to be specified
outside the while loop before it will be acted upon.

-- 
Ken Tyler

mailto://tylereng@pacbell.net


Post a reply to this message

From: Phil Clute
Subject: Re: Help with CGS
Date: 16 Apr 1999 04:36:24
Message: <3716E9E1.2979744@tiac.net>
Aha! that fixed it!

--
...coffee?...yes please! extra sugar,extra cream...Thank you.


Post a reply to this message

From: Markus Becker
Subject: Re: Help with CGS
Date: 16 Apr 1999 04:40:24
Message: <3716EA1D.7F0D75F1@zess.uni-siegen.de>
Ken wrote:
> 
> while loop. The correct way to implement a merge using a csg is like the
> example below. It is your while loop rearranged to operate correctly.
> When using a CSG within a while loop you must move the merge statement
> outside the while statement or it is not acted upon correctly. Don't
> ask me why this is so but I found after many hair pulling sessions and
> then finaly by asking in these groups how to solve my problem.

What do you expect? If you have the "merge" _inside_ the #while
loop, POV creates a "merge"-object fo each pass through the
loop. That's the way things work. No need to ask "why?"

Markus


Post a reply to this message

From: Ken
Subject: Re: Help with CGS
Date: 16 Apr 1999 05:07:48
Message: <3716EE77.2B49791E@pacbell.net>
Markus Becker wrote:
> 
> Ken wrote:
> >
> > while loop. The correct way to implement a merge using a csg is like the
> > example below. It is your while loop rearranged to operate correctly.
> > When using a CSG within a while loop you must move the merge statement
> > outside the while statement or it is not acted upon correctly. Don't
> > ask me why this is so but I found after many hair pulling sessions and
> > then finaly by asking in these groups how to solve my problem.
> 
> What do you expect? If you have the "merge" _inside_ the #while
> loop, POV creates a "merge"-object fo each pass through the
> loop. That's the way things work. No need to ask "why?"
> 
> Markus

Not altogether a programmer type and struggling to use what I can of these
functions I expect no more or no less than what I can figure out myself
of from what I can learn from the generous guidance of others. What is
intuitively obvious to you is sometimes heap big juju magic to me.

-- 
Ken Tyler

mailto://tylereng@pacbell.net


Post a reply to this message

Goto Latest 10 Messages Next 4 Messages >>>

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