POV-Ray : Newsgroups : povray.binaries.images : New Slime-POV feature: function warps : New Slime-POV feature: function warps Server Time
14 Aug 2024 11:19:17 EDT (-0400)
  New Slime-POV feature: function warps  
From: Slime
Date: 26 Oct 2002 16:42:03
Message: <3dbafe1b@news.povray.org>
Well, tired as I am of working with this patch, I wanted to add one more
thing: function warps.

A function warp takes the (x,y,z) point where a pattern is currently being
evaluated, and lets you map it to a new point to evaluate the pattern at.
For example, the three images attached are X-Z planes with the following
pigments, respectively:

pigment {
 bozo
 color_map{[0 rgb 0][1 rgb 1]}
 warp { // this warp does nothing. It maps x to x, y to y, and z to z.
  function{x}
  function{y}
  function{z}
 }
}

pigment {
 bozo
 color_map{[0 rgb 0][1 rgb 1]}
 warp { // this warp does a little more. it maps x to x^2, y to y, and z to
e^z.
  function{x*x}
  function{y}
  function{exp(z)}
 }
}

pigment {
 bozo
 color_map{[0 rgb 0][1 rgb 1]}
 warp { // this warp creates a cool effect, since x,y, and z all effect a
random value that becomes the new x coordinate.
  function{f_noise3d(x,y,z)*10}
  function{y}
  function{z}
 }
}

I made this so that I could have more power over where a triangle mesh is
UV-mapped to. By UV-mapping a mesh to the region <0,0,0>,<1,1,0>, and then
warping that area of texture to, say, a sphere in space, the mesh has
effectively been "UV-mapped" to a sphere.

There are other uses, of course. =)

Oh, and I also might implement just *one* more feature... really, just one
more...

 - Slime
[ http://www.slimeland.com/ ]


Post a reply to this message


Attachments:
Download 'functionwarp0.jpg' (10 KB) Download 'functionwarp1.jpg' (26 KB) Download 'functionwarp2.jpg' (21 KB)

Preview of image 'functionwarp0.jpg'
functionwarp0.jpg

Preview of image 'functionwarp1.jpg'
functionwarp1.jpg

Preview of image 'functionwarp2.jpg'
functionwarp2.jpg


 

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