POV-Ray : Newsgroups : povray.general : viewing the inside of csg_box.pov example : Re: viewing the inside of csg_box.pov example Server Time
2 Aug 2024 16:27:07 EDT (-0400)
  Re: viewing the inside of csg_box.pov example  
From: Mike Williams
Date: 14 Sep 2004 04:19:12
Message: <ZcbKpAAXlqRBFw0F@econym.demon.co.uk>
Wasn't it tec who wrote:
>Hello Everyone,
>    I am executing the csg_box example with no errors. I have modified the 
>exampleto use a mesh2 in place of the box because I want to take the 
>difference of the box (mesh2) and a sphere so I can see the inside triangles 
>of the box. I want to be able to see the inside of the boxes' triangles 
>(mesh2) after I cut away the sphere. I don't want to see the curved slice 
>that the sphere made. Currently, I see the background through the sliced 
>hole but I really want to see the inside of the box (mesh2).

1. The reason you see the background instead of the curved surface of
the sphere is that you have omitted the inside_vector keyword from your
mesh. CSG only works properly with meshes that have their insides
defined. If you add "inside_vector <0, 0, 1>" to the end of your mesh2
then the CSG operation will work correctly.

2. To see the inside of your box you don't want to use "difference" you
want to use "clipped_by". Difference subtracts one solid object from
another. Clipped_by removes part of the surface of the object. It works
just as well with boxes as with meshes, so you can either write

object {
  Mesh_C
  finish {
     ambient 0.2
     diffuse 0.8
  }
  pigment { color red 0 green 0 blue 1 }
  translate <-1.5, 0.5, 1>
  clipped_by {
    sphere { <0.0, 0.0, 0.0>, 1 inverse}
  }
}

or write

box {-1,1
  finish {
     ambient 0.2
     diffuse 0.8
  }
  pigment { color red 0 green 0 blue 1 }
  translate <-1.5, 0.5, 1>
  clipped_by {
    sphere { <0.0, 0.0, 0.0>, 1 inverse}
  }
}

[It's a little hard to see what's going on here but that's just because
it's so dark inside the box.]


>I am using the difference function. Does this function use the stencil 
>buffer? Is there a way to get the vertices back after I cut a chuck out of 
>the box?

There is no "stencil buffer".

In a sense, there aren't really any vertices inside POVRay either,
they're only in the scene description language to allow you to describe
the surfaces.

-- 
Mike Williams
Gentleman of Leisure


Post a reply to this message

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