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:39:29 EST (-0500)
  Re: explicit color mapping f(u,v)->color  
From: Mike Williams
Date: 5 Oct 2003 21:12:50
Message: <DLFTNAAoCMg$EwEV@econym.demon.co.uk>
Wasn't it fjolsvit who wrote:
>Mike Williams wrote:
>> 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]
>>     }
>>   }
>> }
>> 
>
>Thanks.
>
>It looks as though the answere is 'yes, and no'.  I wanted to do this 
>with  a parameterized object or an isosurface.  *6.7.7.1 Supported 
>Objects* of the docs is telling me I can't do it.  This *seems* somewhat 
>strange since I am already defining the parameterized object in terms of 
>UV parameters.  What I've done is to create a composite of areas 
>excluding the coordinate line areas, and then create a union of all 
>patches and coordinate lines.
>
>This does not render very quickly, but it produces the basic desired 
>result.  Now the next trick will be to draw an arbitrary curve on said 
>surface.

Have you considered using Ingo Janssen's "param.inc" system? This
generates a mesh2 object which closely approximates a parametric
isosurface. This has the advantages of being very much faster to render,
and supporting uv_mapping.

Ingo's website: <http://members.home.nl/seedseven/>
My tutorial page: <http://www.econym.demon.co.uk/isotut/param.htm>

-- 
Mike Williams
Gentleman of Leisure


Post a reply to this message

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