POV-Ray : Newsgroups : povray.newusers : UV texture scale center : Re: UV texture scale center Server Time
21 May 2024 21:27:04 EDT (-0400)
  Re: UV texture scale center  
From: Mr
Date: 25 Jan 2015 16:55:00
Message: <web.54c563851bfbdbf6c31ce6010@news.povray.org>
"Mr" <nomail@nomail> wrote:
> clipka <ano### [at] anonymousorg> wrote:
> > 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 :)
>
> Thanks a lot. Hum... well,  Now the same formula doesn't apply to environment
> mapping, there is another discrepency, I'm trying to get rid of:
>
> Blender:
> http://www.pasteall.org/pic/show.php?id=82796
> POV:
> http://www.pasteall.org/pic/show.php?id=82797

The best I could do was this:
http://www.pasteall.org/pic/show.php?id=82820

If you compare with Blender render below, especially look at the clouds
reflexion in the sphere, I think Scale and offset are pretty correct, but the
difference in which clouds are visible through the lateral opening shows the
mapping is still incorrect.
http://wiki.blender.org/uploads/1/12/RenderBranch.jpg

Here is the translation python code:
mappingBlend = "scale 2 scale <%.4g,%.4g,%.4g> translate -1 translate
<%.4g,%.4g,%.4g> " \
               "rotate<0,0,0> " % \
               ((1.0 / t_blend.scale.x),
               (1.0 / t_blend.scale.y),
               (1.0 / t_blend.scale.z),
               (-0.5)-(-0.5/t_blend.scale.x)+ t_blend.offset.x,
               (-0.5)-(-0.5/t_blend.scale.y)+ t_blend.offset.y,
               (-0.5)-(-0.5/t_blend.scale.z)+ t_blend.offset.z)
I had to use map_type 0 but I am guessing what would be needed for more correct
results would be cube mapping? (map_type = 3 ?) which doesn't exist yet does it?
maybe in UberPOV?  otherwise, which solution would you advise? anything else
than giving up sky_sphere for a dumb (how big?) box?


Post a reply to this message

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