POV-Ray : Newsgroups : povray.newusers : UV texture scale center : Re: UV texture scale center Server Time
18 May 2024 02:18:57 EDT (-0400)
  Re: UV texture scale center  
From: clipka
Date: 25 Jan 2015 02:19:58
Message: <54c4991e@news.povray.org>
Am 25.01.2015 um 07:58 schrieb Mr:

> it works seamlessly, now both uv textures map the same. this is the python
> making the translation (z can be scaled and offset as well):
>
> mappingDif = ("scale <%.4g,%.4g,%.4g> translate <%.4g,%.4g,%.4g>" % \
>                ( 1.0 / t_dif.scale.x,
>                1.0 / t_dif.scale.y,
>                1.0 / t_dif.scale.z,
>                0.5-(0.5/t_dif.scale.x) + t_dif.offset.x,
>                0.5-(0.5/t_dif.scale.y) + t_dif.offset.y,
>                0.5-(0.5/t_dif.scale.z) + t_dif.offset.z))

Looks good. The offset should be fine, too, provided Blender applies 
offset after scaling; if instead it applies offset before scaling, 
dividing the offset by t_dif.scale.* should do the trick.

Glad I could help :)


Post a reply to this message

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