POV-Ray : Newsgroups : povray.general : explicit color mapping f(u,v)->color : Re: explicit color mapping f(u,v)->color Server Time
7 Nov 2024 13:36:39 EST (-0500)
  Re: explicit color mapping f(u,v)->color  
From: Mike Williams
Date: 4 Oct 2003 20:25:50
Message: <xQeA6JA6P2f$Ew7E@econym.demon.co.uk>
Wasn't it Fjolsvit who wrote:
>This may be obvious, and I've simply overlooked it, but I can't seem to 
>figure out a way to explicitly say what color I want at a specific point 
>on a surface.  Basically what I want is a way to draw the u and v 
>coordinate lines ...u = -2, u = -1, u = 0, u = 1, u = 2 ...,...v = -2, v 
>= -1, v = 0, v = 1, v = 2 ..., etc.
>
>This *seems* like it should be easy.  Suggestions?

If the object is one of those which supports uv_mapping, then you can
use a uu_mapped pigment function something like this:

#declare Spacing = 20;                    
sphere {0,1
  uv_mapping 
  pigment {
    function {min(abs(sin(u*pi*Spacing)),
              abs(sin(v*2*Spacing)))}
    color_map { [0.0 rgb 0]
                [0.05 rgb 0]
                [0.05 rgb 1]
                [1 rgb 1]
    }
  }
}

-- 
Mike Williams
Gentleman of Leisure


Post a reply to this message

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