POV-Ray : Newsgroups : povray.newusers : Image mapping on triangles : Re: Image mapping on triangles Server Time
8 Jul 2024 00:59:21 EDT (-0400)
  Re: Image mapping on triangles  
From: solanb
Date: 5 Nov 2009 03:55:01
Message: <web.4af292dba22773f2cf0bfa9c0@news.povray.org>
Thanks everybody for your help.

uv_mapping is indeed the right way to solve my problem.

I define first the texture from my image file.
Then I create the mesh with the triangles' coordinates and calculate the
uv_vectors coordinates from the distances between the triangles coordinates.

Have a nice day!
Benoit

clipka <ano### [at] anonymousorg> wrote:
> solanb schrieb:
>
> > Ok, but then how to define the uv_vector corresponding to each triangle?
> >
> > My image to be mapped consists of spots of a given dimension (eg. 1cm diameter),

> > also in cm. And I want to keep the scale of my image when I project it on the
> > scene's triangles.
>
> Like with all image-backed texture stuff in POV-Ray, coordinate values
> <0,0>, <0,1>, <1,0> and <1,1> correspond to the corners of the texture
> image.
>
> If you want the image to repeat, just use larger coordinate values; e.g.
> if you use <0,0>, <0,100>, <100,0> for some triangle's UV coordinates,
> the image will repeat 100 times along the edges.
>
> Provided that you know the shape of your triangles, you can compute
> suitable UV coordinates from the length of any single of the triangle's
> edges (using vlength(P1-P2) for instance, or using the same base values
> you use to generate the triangle XYZ coordinates in the first place).


Post a reply to this message

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