POV-Ray : Newsgroups : povray.newusers : cracked glass: interface between pieces looks black Server Time
31 Jul 2024 00:30:32 EDT (-0400)
  cracked glass: interface between pieces looks black (Message 1 to 6 of 6)  
From: oldmicah
Subject: cracked glass: interface between pieces looks black
Date: 17 Jul 2003 22:15:01
Message: <web.3f175787a9275eec9cfc34200@news.povray.org>
Hello,

  Since the newsgroup is pretty much batting a 1000 with my questions, I
thought I'd throw another one out.

  I'm trying to simulate a pair of glasses with a cracked lens.  My first
thought was to split the lens into several pieces, and then, when put
together, they would nicely simulate the broken glass of the lens.  The
problem is that in the intersection between the pieces, I'm getting a black
area in my rendering.  Reading another post, I first tried overlapping the
two pieces, and then tried separating them with a space, and finally tried
putting them flush.  All three yeilded the black area in the interface.

image here: http://homepage.mac.com/sstrange/POV/glasses.jpg
(thinking it might be an artifact of the dark grey ground) partial image w.
white ground here: http://homepage.mac.com/sstrange/POV/glasses2.jpg

#declare Lens=
  intersection{
    sphere{<0,-5,0>, 8}
    sphere{<0,5,0>, 8}
    scale 0.16
    texture{Glass3}
    //finish{ambient 0.3}
 }

#declare CrackedLens=
  union{
     difference {
   object{Lens}
   box{<-8,-8,-8> <-.001,8,8>}
   }
     difference {
   object{Lens}
   box{<.001,8,8> <8,8,8>}
   }
 }

  Am I missing something obvious or is there a better way to simulate
cracked glass?

 as always, many thanks,
Steven


Post a reply to this message

From: Christopher James Huff
Subject: Re: cracked glass: interface between pieces looks black
Date: 17 Jul 2003 23:53:05
Message: <cjameshuff-393C10.22472517072003@netplex.aussie.org>
In article <web.3f175787a9275eec9cfc34200@news.povray.org>,
 "oldmicah" <nomail@nomail> wrote:

>   I'm trying to simulate a pair of glasses with a cracked lens.  My first
> thought was to split the lens into several pieces, and then, when put
> together, they would nicely simulate the broken glass of the lens.  The
> problem is that in the intersection between the pieces, I'm getting a black
> area in my rendering.  Reading another post, I first tried overlapping the
> two pieces, and then tried separating them with a space, and finally tried
> putting them flush.  All three yeilded the black area in the interface.

Have you tried a higher max_trace_level?
Well, you didn't mention it, so you probably haven't. Put something like 
"global_settings {max_trace_level 20}" at the beginning of your scene. 
Basically, this tells POV to go through more transparent or reflecting 
surfaces before it stops tracing rays.

-- 
Christopher James Huff <cja### [at] earthlinknet>
http://home.earthlink.net/~cjameshuff/
POV-Ray TAG: chr### [at] tagpovrayorg
http://tag.povray.org/


Post a reply to this message

From: Christopher James Huff
Subject: Re: cracked glass: interface between pieces looks black
Date: 17 Jul 2003 23:59:25
Message: <cjameshuff-EB452A.22534617072003@netplex.aussie.org>
In article <cja### [at] netplexaussieorg>,
 Christopher James Huff <cja### [at] earthlinknet> wrote:

> In article <web.3f175787a9275eec9cfc34200@news.povray.org>,
>  "oldmicah" <nomail@nomail> wrote:
> 
> >   I'm trying to simulate a pair of glasses with a cracked lens.  My first
> > thought was to split the lens into several pieces, and then, when put
> > together, they would nicely simulate the broken glass of the lens.  The
> > problem is that in the intersection between the pieces, I'm getting a black
> > area in my rendering.  Reading another post, I first tried overlapping the
> > two pieces, and then tried separating them with a space, and finally tried
> > putting them flush.  All three yeilded the black area in the interface.
> 
> Have you tried a higher max_trace_level?
> Well, you didn't mention it, so you probably haven't. Put something like 
> "global_settings {max_trace_level 20}" at the beginning of your scene. 
> Basically, this tells POV to go through more transparent or reflecting 
> surfaces before it stops tracing rays.

Oh, and you should probably use the air-gap method. It will simulate an 
actual crack more closely, though if they are too close you may get 
precision problems. There probably isn't a really accurate way of doing 
this in POV, but another way might be to use a height field, mesh, or 
some other irregular flat object for the crack surface, and clip it to 
the lens object. This would avoid the CSG you are using, and might 
simplify more complex cracks, though it doesn't accurately model real 
cracks.

-- 
Christopher James Huff <cja### [at] earthlinknet>
http://home.earthlink.net/~cjameshuff/
POV-Ray TAG: chr### [at] tagpovrayorg
http://tag.povray.org/


Post a reply to this message

From: Tim Nikias v2 0
Subject: Re: cracked glass: interface between pieces looks black
Date: 18 Jul 2003 04:25:18
Message: <3f17aeee@news.povray.org>
What you're suggesting is fine, as these are common problems
when handling CSG, but the solution is far easier:

You're differencing two objects, right? One is a glass-lens,
with the required texture. You're cutting parts away with
a box. What kind of texture does it have?
It's the black default texture...

When doing CSG where I just want to cut some material
into a proper form, I do all the CSG first, and apply the
textures later. When cutting a portion away, that surface is,
when being raytraced, actually the surface of the cut-away
object, not the original object's surface. Thus, it uses the
texture of the other object.

Try it. Take a red sphere and cut one half away with a blue
box.


-- 
Tim Nikias v2.0
Homepage: http://www.digitaltwilight.de/no_lights


> >
> > >   I'm trying to simulate a pair of glasses with a cracked lens.  My
first
> > > thought was to split the lens into several pieces, and then, when put
> > > together, they would nicely simulate the broken glass of the lens.
The
> > > problem is that in the intersection between the pieces, I'm getting a
black
> > > area in my rendering.  Reading another post, I first tried overlapping
the
> > > two pieces, and then tried separating them with a space, and finally
tried
> > > putting them flush.  All three yeilded the black area in the
interface.
> >
> > Have you tried a higher max_trace_level?
> > Well, you didn't mention it, so you probably haven't. Put something like
> > "global_settings {max_trace_level 20}" at the beginning of your scene.
> > Basically, this tells POV to go through more transparent or reflecting
> > surfaces before it stops tracing rays.
>
> Oh, and you should probably use the air-gap method. It will simulate an
> actual crack more closely, though if they are too close you may get
> precision problems. There probably isn't a really accurate way of doing
> this in POV, but another way might be to use a height field, mesh, or
> some other irregular flat object for the crack surface, and clip it to
> the lens object. This would avoid the CSG you are using, and might
> simplify more complex cracks, though it doesn't accurately model real
> cracks.
>
> -- 
> Christopher James Huff <cja### [at] earthlinknet>
> http://home.earthlink.net/~cjameshuff/
> POV-Ray TAG: chr### [at] tagpovrayorg
> http://tag.povray.org/


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.501 / Virus Database: 299 - Release Date: 14.07.2003


Post a reply to this message

From: SeeSchloss
Subject: Re: cracked glass: interface between pieces looks black
Date: 18 Jul 2003 12:27:50
Message: <3f182006@news.povray.org>
Well I think you should just apply the texture on the whole CSG object
(either on the two differences or on the union) because in your scene, the
cut parts use the texture of the boxes (wich is the default texture :
black).


Post a reply to this message

From: oldmicah
Subject: Re: cracked glass: interface between pieces looks black
Date: 18 Jul 2003 13:25:01
Message: <web.3f182cf39c5f59e09cfc34200@news.povray.org>
Hello,

  The problem was definitely that I was 'black textured' box I was
subtracting from the lens. Applying the texture after doing the csg fixed
things.  At this point I'm getting a pretty good looking cracked lens by
having an offset center and doing random sized glass slivers.  Not perfect,
but good enough for what I'm working on.

for those interested, the image is here:
http://homepage.mac.com/sstrange/POV/glasses3.jpg

  Thanks again for everyone's help!

learning slowly but surely,
Steven


Post a reply to this message

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