POV-Ray : Newsgroups : povray.newusers : Problems intersecting a transparent sphere and a box with an image : Problems intersecting a transparent sphere and a box with an image Server Time
30 Jul 2024 16:27:20 EDT (-0400)
  Problems intersecting a transparent sphere and a box with an image  
From: Laurent Duperval
Date: 24 Dec 2003 08:00:02
Message: <web.3fe98d837589c98b7dec0c820@news.povray.org>
Hi,

In my quest to generate some decorations for a Christmas card, I want to try
to create ornaments with pictures of my kids in them. Originally, I wanted
the picture on the ornament but it doesn't look good. So now, I'm trying to
get the picture to look like it's inside the ornament. The ornament itself,
I want it to look like see-through glass. Well, it ain't working. I thought
intersection{} would give me what I want but not quite. This is what I have
so far:

#include "shapes.inc"
#include "colors.inc"

#background { color <1.000,1.000,1.000> }

camera {
    location <0, 2, -3>
    look_at  <0, 0,  0>
}
light_source { <2, 4, -3> color White}

#declare redBall =
sphere {
    <0,0,0>,1
    pigment {
        color rgbt <1,0,0,0.1>
    }
    finish{phong 1 diffuse 0 ambient 1}
}

#declare alekoFrame =
box{<-1,-1,0.01>, <1,1,.01>
    texture{
        pigment{
            image_map{
                png "aleko.png"
            }
        }
    }
    finish{diffuse 0 ambient 1}
    //scale 5
    //translate <-100,-100,250>+265*z
}


#declare alekoBall = intersection{
    object{
        alekoFrame
    }
    object {redBall}
}

object {alekoBall}


I'm seeing a few problems:

- I don't see the sphere at all (with the phong). I basically just see a
clipped circle with the picture

- My picture appears four times, I guess once for each 1x1x1 box. How do I
make it appear once, but take up all the space of the box? And I only want
it on one side of the box.

- My picture appears speckled. I'm not sure what that's all about. By
speckled, I mean that it looks like a bunch of random pixels have been
removed from the picture.

- My ball doesn't seem very 3D-ish and neither does it look very
see-through... I see that changing ambient to 0 gives a better spheric look
to the ball. But still not very see-through-ish. Maybe I need to put some
kind of textured background to get the effect I want. I'll look into that.
I see that using rgbf instead of rgbt helps also.

If you have some pointers for me, I'd appreciate it much.

Thanks!

L


Post a reply to this message

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