PDA

View Full Version : Lua script for Polar mapping correction of seamless textures


staigerman
11-09-2006, 07:35 PM
If you texture a sphere you know how it can pinch the poles and show seams. There are tools for Photoshop to remap with a polar transform so that a spherical projection won't show these.

Paul Bourke has described the algorithm in 2001. Here's a Lua script version:

http://www.thebest3d.com/dogwaffle/lua/polar

This should work in any of the Project Dogwaffle versions supporting plugins (PD Artist, PD Pro, PD 2 and PD 1.2 freeware version), as well as the GIMP and ArtWeaver, since this script does not make use of any Dogwaffle-only or Artweaver-only GUI features, it is in fact gui-less.

I hope it is useful. It was created in about 2 hours late last night - and I don't have uch scripting experience day to day with Lua, just the occasional dabble. So it was very interesting for me to see the well written code from Paul turn into a great Lua experiment.

If you use the GIMP, ArtWeaver or any Dogwaffle, I'd love to hear feedback. If you use other imaging tools that can run this script you absolutely must share your information and experience for the benefit of all starving artits :-)

billrobertson42
11-11-2006, 06:51 AM
How would you use it in the gimp?

staigerman
11-11-2006, 07:22 AM
How would you use it in the gimp?

There's a plugin available for the GIMP called gluas, it's what served as the basis also for the DogLua plugin in Dogwaffle and the Lua plugin in ArtWeaver. I forget who created it, but it's prominently visible and accessible at the gimp's website. I have a not-so-recent installation of Gimp on this system, not sure if gluas came installed with it automatically, I think not.

When you have the Lua capability installed, whether in Gimp or Artweaver or Dogwaffle or elsewhere, you should be able to browse for files ending in .lua, select one and execute that script. It will apply to the current image, perhaps the current layer (I'll have to re-visit that on the Gimp's side)

staigerman
11-11-2006, 07:29 AM
Here is one of the pages on gluas/Lua at the gimp:
http://pippin.gimp.org/image_processing/appendix_gluas.html

I probably have more at
www.thebest3d.com/dogwaffle/lua (http://www.thebest3d.com/dogwaffle/lua)

staigerman
11-11-2006, 07:42 AM
I installed gluas, and it's now in the Filter menu:

Filters > Generic > gluas...

staigerman
11-11-2006, 02:34 PM
I installed gluas, and it's now in the Filter menu:

Filters > Generic > gluas...

oh and I forgot to mention... works like a charm on Gimp (I have v2.2) though quite a bit faster in Dogwaffle. But hey it works.

CGTalk Moderation
11-11-2006, 02:34 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.