POV-Ray : Newsgroups : povray.newusers : UV Texture question Server Time
29 Jul 2024 06:29:13 EDT (-0400)
  UV Texture question (Message 1 to 2 of 2)  
From: McHannemann
Subject: UV Texture question
Date: 22 Apr 2006 05:50:00
Message: <web.4449fb22bcde337c191c02710@news.povray.org>
I would like to know if this is possible:

when I have a surface position(X,Y,Z) of an uv-mapped object
I would like to get the Pigment of a texture for this position

Hope you can help me,

REgards,

Thor


Post a reply to this message

From: Chris B
Subject: Re: UV Texture question
Date: 29 Apr 2006 07:36:44
Message: <44534fcc@news.povray.org>
"McHannemann" <nomail@nomail> wrote in message 
news:web.4449fb22bcde337c191c02710@news.povray.org...
>I would like to know if this is possible:
>
> when I have a surface position(X,Y,Z) of an uv-mapped object
> I would like to get the Pigment of a texture for this position
>
> Hope you can help me,
>
> REgards,
>
> Thor
>

Hi Thor,

The 'eval_pigment' macro can give you the color value of a pigment at a 
point in space, but I'm not sure that you'd be able to use it directly in 
this instance, if that pigment is subsequently uv-mapped to a surface.

If you are able to store the UV mapping information in a machine readable 
format (e.g. in an array), you may be able to work backwards to calculate 
the corresponding coordinates on the 'unmapped' pigment, then use the 
'eval_pigment' macro to lookup the color. The complexity of doing this will 
very much depend upon the complexity of the shape and the format of the 
information you are starting with (as well as your programming skills of 
course).

Regards,
Chris B.


Post a reply to this message

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