|
![](/i/fill.gif) |
> Hello, this is my first post here!
>
> I'm working on a project to be displayed in a full-dome planetarium. I rendered
> some test animation that I haven't had the opportunity to see in the planetarium
> yet. However I tought it would be nice to create a simulation with our favorite
> ray tracer.
>
> What I have done so far is to write a macro to build a dome model like so :
>
> #macro dome(position, rayon, insideTexture, outsideTexture)
> difference{
> difference{
> sphere{position, rayon*1.11 texture{outsideTexture}}
> sphere{position, rayon texture{insideTexture}}
>
> }
> box{position-<rayon*1.11,0,rayon*1.11>,
> position+<rayon*1.11,rayon*1.11,rayon*1.11>}
> }
> #end
>
> As you can see it is made of a sphere hollowed out by another smaller one and
> then cut in two by a box.
>
> I'm calling this macro from inside an object so I can apply rotation, scalling,
> etc.. if needed from there :
>
> object {
> dome(<0,0,0>, 1, insideT, outsideT)
> rotate x*180
> }
>
> The outside texture declaration (a simple colour pigment):
> #declare outsideT = texture{
> pigment{color Green}
> }
>
> This is working well, but now I'm having troubles figuring out how to texture
> the inside of the dome. At the moment my texture declaration that I pass to the
> macro as "insideTexture" is as follow :
>
> #declare insideT = texture{
> pigment{
> uv_mapping
> image_map{png "data/FisheyeTest.png"}
> }
> }
>
> where FisheyeTest.png is a square image (ratio width/height = 1/1) rendered with
> POV-Ray using the fisheye camera.
>
> The texture shows up but it is not set up properly. I tried different rotation,
> map_type, but no luck so far.
>
> I'm really stuck, could someone please help me?
>
> Best regards,
> Jonsku
>
>
>
The various mapings assume that the object is located at or around the
origin. If "position" is not <0,0,0>, then the maping will get distorded.
In your case, the inside_texture feature is of no use. It's usefull when
the inside of an object is visible because the camera is located inside,
there are some transparent parts in the normal texture or the object
have been clipped. Also usefull when you use the open option with some
primitives or have an open mesh or patch and you can see both sides.
As you observe your sphere from the center, you don't need a texture for
the outer part, only on the concave part.
You can use a single texture applied to the whole object OR a single
texture applied to the smaller sphere.
To help you with the texturing, create your sphere at the origin, then,
only if needed, translate it to the final location.
Your macro becomes something like this:
#macro dome(position, rayon, insideTexture, outsideTexture)
difference{
difference{
sphere{0, rayon*1.11 texture{outsideTexture}}
sphere{0, rayon texture{insideTexture}}
}
box{<rayon*1.11,0,rayon*1.11>,
<rayon*1.11,rayon*1.11,rayon*1.11>}
translate position
}
#end
It can even be simplified further like so:
#macro dome(position, rayon, insideTexture, outsideTexture)
difference{
difference{
box{position-<rayon*1.11,0,rayon*1.11>,
position+<rayon*1.11,rayon*1.11,rayon*1.11>} sphere{position,
rayon texture{insideTexture}}
}
}
#end
This option works as long as you only want to see the inside of the dome
and the camera is located appropriately.
Alain
Post a reply to this message
|
![](/i/fill.gif) |