POV-Ray : Newsgroups : povray.general : Texturing the inside of a hollow hemisphere : Re: Texturing the inside of a hollow hemisphere Server Time
29 Jul 2024 20:26:22 EDT (-0400)
  Re: Texturing the inside of a hollow hemisphere  
From: Kenneth
Date: 11 Sep 2010 05:45:00
Message: <web.4c8b4ea7e8b7098e196b08580@news.povray.org>
"Jonsku" <nomail@nomail> wrote:


> 3)http://imgur.com/7CPyk.png
> texture{
>     pigment{
>         image_map{gif "data/grid.gif" once}
>     }
> }
>
> In this case the texture doesn't show up, all you can see is the dark rim,
> which I think is using data from the image_map. The green colour comes
> from the outside part of the dome for some reason....

Sorry for the mix-up; I re-read your original post and now understand what your
questions were.

Your 'once' example above leads me to think that the image_map may have been
translated *somewhere else* in space, no longer lining up with the dome. OR that
the dome was created in some location that doesn't match up with its applied
image_map. Looking at your macro in a more detailed way, I see a possible
problem (which may or may not be the cause of your troubles):

#macro dome(position, rayon, insideTexture, outsideTexture)
    difference{
        difference{
            sphere{position, rayon*1.11 texture{outsideTexture}}
            sphere{position, rayon texture{insideTexture}}
....etc.

Depending on what values you use for *position* and *rayon*, you could be
creating a dome that, right from the start, doesn't line up with your image_map
texture.  For example, let's say *position* is chosen to be <3,5,8> and *rayon*
is 2.3--in such a case, /neither/ of the two textures is going to line up with
the dome. That's because the dome has already been translated (and scaled),
whereas the textures are being applied at their 'default'
positions/projections/scalings. (Textures don't automatically follow an object
that's been *created* somewhere other than at the origin.) So you would likewise
need to translate and scale the textures as well, if they are to 'follow' the
dome.

A better way to code the macro would be *something* like this--creating a
default-sized dome, applying the textures, *then* scaling and translating
everything afterward:

difference{
        difference{
            sphere{<0,0,0>,1.1 texture{outsideTexture}}
            sphere{<0,0,0>, 1 texture{insideTexture}}
                  }
        box{.....}
    scale rayon
    translate position
........


Post a reply to this message

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