POV-Ray : Newsgroups : povray.general : Texturing the inside of a hollow hemisphere Server Time
30 Jul 2024 00:28:17 EDT (-0400)
  Texturing the inside of a hollow hemisphere (Message 11 to 12 of 12)  
<<< Previous 10 Messages Goto Initial 10 Messages
From: Alain
Subject: Re: Texturing the inside of a hollow hemisphere
Date: 11 Sep 2010 16:43:58
Message: <4c8bea0e$1@news.povray.org>

> 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

From: clipka
Subject: Re: Texturing the inside of a hollow hemisphere
Date: 17 Sep 2010 15:00:55
Message: <4c93bae7$1@news.povray.org>
Am 10.09.2010 16:04, schrieb Jonsku:

> 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.

AFAIK There's no mapping that matches the fisheye camera, so if you're 
stuck with that format for your to-be-projected material, things will 
get complicated.

If however you're free to pick a camera type, then the spherical camera 
is what you want, as it precisely matches the uv_mapping for spheres. 
(Alternatively, you can use non-uv_mapping, with "map_type 1".)


Post a reply to this message

<<< Previous 10 Messages Goto Initial 10 Messages

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