POV-Ray : Newsgroups : povray.advanced-users : fuctions and uv_mapping Server Time
1 Nov 2024 07:24:57 EDT (-0400)
  fuctions and uv_mapping (Message 1 to 5 of 5)  
From: David Burnett
Subject: fuctions and uv_mapping
Date: 24 Mar 2003 07:21:59
Message: <pan.2003.03.24.12.21.25.112773@ntlworld.com>
Is there a simple way to apply uv_mapping within a function.

I'm looking for something that would work like..

#declare Chladni_uv = function{	
    pigment { 
        function{Chladni_2d (x,y,z,4,5)}
  	uv_mapping
   } 
}

if it were valid syntax.

Dave


Post a reply to this message

From: ABX
Subject: Re: fuctions and uv_mapping
Date: 24 Mar 2003 07:32:41
Message: <pgut7vg07fe0jcih5mgukk6a8p04870mec@4ax.com>
On Mon, 24 Mar 2003 12:21:25 +0000, "David Burnett" <var### [at] ntlworldcom>
wrote:
> #declare Chladni_uv = function{	
>   pigment { 
>     function{Chladni_2d (x,y,z,4,5)}
>     uv_mapping
>   } 
> }

uv_mapping is always defined in relation to geometry of some shape. There is
lack of shape in above example so no uv_mapping available. But you can always
use own user-defined functions which translates x,y,z coordinates to some 2D
coordinates in your preferred way.

ABX


Post a reply to this message

From: Christoph Hormann
Subject: Re: fuctions and uv_mapping
Date: 24 Mar 2003 07:48:52
Message: <3E7EFEC8.896E7DB3@gmx.de>
ABX wrote:
> 
> uv_mapping is always defined in relation to geometry of some shape. There is
> lack of shape in above example so no uv_mapping available. But you can always
> use own user-defined functions which translates x,y,z coordinates to some 2D
> coordinates in your preferred way.

None the less it could be useful in some situations if usage of functions
in pigments would allow both 3d and uv coordinates.  You could create
patterns with a structure following the surface (uv coordinates) but this
structure varying with the 3d position.   AFAIK Renderman shader language
has this possibility.  

Christoph

-- 
POV-Ray tutorials, include files, Sim-POV,
HCR-Edit and more: http://www.tu-bs.de/~y0013390/
Last updated 28 Feb. 2003 _____./\/^>_*_<^\/\.______


Post a reply to this message

From: David Burnett
Subject: Re: functions and uv_mapping
Date: 24 Mar 2003 12:13:46
Message: <pan.2003.03.24.17.13.10.896437@ntlworld.com>
On Mon, 24 Mar 2003 13:49:12 +0100, Christoph Hormann wrote:


> 
> ABX wrote:
>> 
>> uv_mapping is always defined in relation to geometry of some shape.
>> There is lack of shape in above example so no uv_mapping available. But
>> you can always use own user-defined functions which translates x,y,z
>> coordinates to some 2D coordinates in your preferred way.
> 
> None the less it could be useful in some situations if usage of
> functions in pigments would allow both 3d and uv coordinates.

Thats the sort of thing I'd like, if functions where 'extended' so that
they passed x,y,z,u,v when rendering a uv mapped object or just u,v.

All this came from a uv_mapped 2D pigment function that I wanted to try
using as iso_function to 'displace' a sphere, to give that extra inch of
realism over using it as a normal function.

Dave


Post a reply to this message

From: Christoph Hormann
Subject: Re: functions and uv_mapping
Date: 24 Mar 2003 12:48:33
Message: <3E7F4506.D82A7B7B@gmx.de>
David Burnett wrote:
> 
> [...]
> 
> All this came from a uv_mapped 2D pigment function that I wanted to try
> using as iso_function to 'displace' a sphere, to give that extra inch of
> realism over using it as a normal function.

This has nothing to do with what i mentioned.  You can't use uv-mapping
for a displacement function since UV coordinates are only available on the
surface (i.e. in textures).  You could generalize that to uvw-coordinates
but that would require elementary changes and would only work for certain
very basic objects.

Using angular coordinates for displacing the surface of a sphere is no
problem with the current function syntax.

Christoph

-- 
POV-Ray tutorials, include files, Sim-POV,
HCR-Edit and more: http://www.tu-bs.de/~y0013390/
Last updated 28 Feb. 2003 _____./\/^>_*_<^\/\.______


Post a reply to this message

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