Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Making textures for spherical, hemispherical prims

Saregin Martynov
Registered User
Join date: 27 Jan 2009
Posts: 13
12-14-2009 22:22
I want to be able to transform a circular image so that it is properly proportioned to serve as a texture for a sphere or hemisphere, like a polar projection of an Earth map. Can it be done, whether using an image editor (Photoshop, Paint Shop Pro) or a 3D editor like Blender?
Chosen Few
Alpha Channel Slave
Join date: 16 Jan 2004
Posts: 7,496
12-14-2009 23:52
In Photoshop, check out the Polar Coordinates filter.

In a full-featured 3D package like Blender or Maya, you have all kinds of projection options at your disposal.


May I ask why you're starting with a circular image? It would be simpler in many ways to use a rectangle.
_____________________
.

Land now available for rent in Indigo. Low rates. Quiet, low-lag mainland sim with good neighbors. IM me in-world if you're interested.
Saregin Martynov
Registered User
Join date: 27 Jan 2009
Posts: 13
12-16-2009 10:42
To make a hemispherical lamp.
Saregin Martynov
Registered User
Join date: 27 Jan 2009
Posts: 13
12-16-2009 10:54
I'm having trouble finding the Paint Shop Pro parallel to the Polar Coordinates filter.
Chosen Few
Alpha Channel Slave
Join date: 16 Jan 2004
Posts: 7,496
12-16-2009 11:47
Unless they've changed something in recent versions, it's called Polar Coordinates in PSP, same as in PS. I believe you'll find it under Effects -> Distortion Effects -> Polar Coordinates. Set it to "Polar to rectangular". If they've moved it since the last time I looked at PSP, search your help file for "polar coordinates". It's in there somewhere.

I still don't get why you'd want to start with a circular texture, but good luck. :)
_____________________
.

Land now available for rent in Indigo. Low rates. Quiet, low-lag mainland sim with good neighbors. IM me in-world if you're interested.
Saregin Martynov
Registered User
Join date: 27 Jan 2009
Posts: 13
12-18-2009 11:16
By using a rectangular image, you mean doing a Mercator projection instead of polar? How would that be done?
Chosen Few
Alpha Channel Slave
Join date: 16 Jan 2004
Posts: 7,496
12-18-2009 11:28
That's what SL does by default. Every texture we apply to a sphere is wrapped cylindrically around the surface. Or, put another way, every sphere unwraps to a flat rectangle. A sphere in SL is just a rectangular mesh, swept around a circle in 3D space, and collapsed to poles at both ends. That's it.
_____________________
.

Land now available for rent in Indigo. Low rates. Quiet, low-lag mainland sim with good neighbors. IM me in-world if you're interested.
Saregin Martynov
Registered User
Join date: 27 Jan 2009
Posts: 13
12-18-2009 21:01
I've seen how that works, using a wallpaper pattern on a sphere to test. How do I design a Mercator-style texture for a sphere or hemisphere? For example, say I want to plant an image of a pizza onto a hemisphere. (First round object I could think of.)
Chosen Few
Alpha Channel Slave
Join date: 16 Jan 2004
Posts: 7,496
12-18-2009 22:57
Assuming you're working with a sphere that has been dimpled, not cut, then you've only got one pole to worry about. This makes the UV layout pretty easy to visualize. The bottom of the rectangle is the equator, and the top is the pole.

So, if I were to do a pizza, I'd want the crust to be a bread-colored stripe across the bottom edge of the canvas. Pepperoni slices would get increasingly larger and wider as they approach the top, and would be smaller and narrower toward the bottom. This is so that when the wrapped texture squishes inward as it approaches the pole, and stretches outward as it approaches the equator, all the slices end up the same size, and in proper aspect. If there's a pepperoni in the exact center of the pizza, it would be widened all the way, as a red stripe across the entire top of the canvas, the same way the crust forms a stripe across the bottom.

Here's an example:



I did the above with the Polar Coordinates filter in Photoshop, starting with an ordinary photograph of a pizza I found on Google.








Disclaimer: Just so I can say I said it, don't make textures from other people's photographs. This particular case was for educational purposes, so it's technically fair use. But still, it's not the best idea. Take your own photo of your own pizza. :)
_____________________
.

Land now available for rent in Indigo. Low rates. Quiet, low-lag mainland sim with good neighbors. IM me in-world if you're interested.
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
12-19-2009 00:58
From: Chosen Few
Unless they've changed something in recent versions, it's called Polar Coordinates in PSP, same as in PS. I believe you'll find it under Effects -> Distortion Effects -> Polar Coordinates. Set it to "Polar to rectangular". If they've moved it since the last time I looked at PSP, search your help file for "polar coordinates". It's in there somewhere.

I still don't get why you'd want to start with a circular texture, but good luck. :)

not built in before v8 I think, although there are plugins
_____________________
|
| . "Cat-Like Typing Detected"
| . This post may contain errors in logic, spelling, and
| . grammar known to the SL populace to cause confusion
|
| - Please Use PHP tags when posting scripts/code, Thanks.
| - Can't See PHP or URL Tags Correctly? Check Out This Link...
| -
Saregin Martynov
Registered User
Join date: 27 Jan 2009
Posts: 13
12-19-2009 21:48
I found the "polar coordinates" function in PSP. This site was helpful.

http://loriweb.pair.com/8polarcoord1.html
Chosen Few
Alpha Channel Slave
Join date: 16 Jan 2004
Posts: 7,496
12-19-2009 22:14
Good to know you "found" it, exactly where I said it would be. :)
_____________________
.

Land now available for rent in Indigo. Low rates. Quiet, low-lag mainland sim with good neighbors. IM me in-world if you're interested.
Peggy Paperdoll
A Brat
Join date: 15 Apr 2006
Posts: 4,383
12-19-2009 22:57
It works in GIMP too.

Filters > Distorts > Polar Coordinates
Abu Nasu
Code Monkey
Join date: 17 Jun 2006
Posts: 476
12-19-2009 23:32
One of my all time favorite tutorials:

http://www.vantagegraphics.co.uk/pages/notebook/mapsphere.html


Every time this subject comes up, I can feel a rampage coming on. I haven't gone on a rampage in quite awhile and I really don't want to any time soon. Yeah, I can get ugly.
Chosen Few
Alpha Channel Slave
Join date: 16 Jan 2004
Posts: 7,496
12-19-2009 23:52
You, get ugly, Abu? Somehow I doubt that's possible. You've always got such wonderful contributions, and you share your inventiveness so freely, I've always considered you one of the saints of this forum.

Out of curiosity, what is it about sphere mapping that might draw out your inner wrath?
_____________________
.

Land now available for rent in Indigo. Low rates. Quiet, low-lag mainland sim with good neighbors. IM me in-world if you're interested.
Abu Nasu
Code Monkey
Join date: 17 Jun 2006
Posts: 476
12-20-2009 01:21
Yes, I can get ugly. But it doesn't happen very often. There is this really awesome rampage I went on a few years ago where I totally trashed talked Bert Monroy and Russell Brown, but mostly Brown. OMG it was so funny. I get so angry when someone has an awesome idea and doesn't realize the potential (Monroy). Or when someone has an awesome idea but has it all wrong (Brown). I was seriously ready to step into the ring. I did my best to stay calm and set things straight.

Umm...

Polar Coordinates really not that hard to come to grips with. And yet I see folks fighting with it all the time. Well, not all the time, but too often for my comfort. Makes my brain twitch everytime the subject comes up.

The last time I picked a filter to write comprehensive tutorials about, it took me 2 years. Have you seen my Displace tutorials on the original Tech Slop site? I could do the same thing for Polar Coordinates.

Ugh. I need to stop, else I might start taking notes. Jeez, notes. I wonder if I could auction my notebooks on eBay? Heh. LOL

edit:

BTW, thanks for thinking me a saint. I've pretty much always been free about all of my material et al. I will try to mantain this as much as possible. Definitely thanks to you and some of the others for handling the 'easy' questions. I don't need the answers to the easy things, but I certaintly definitely most absolutely appreciate your time and others' time spent answering with them. Kudos.
Abu Nasu
Code Monkey
Join date: 17 Jun 2006
Posts: 476
12-20-2009 06:42
Polar Coordinates Awesome Tippage

When you do certain acrocbatics with PC, chances are you will smear pixels. You know, a circle in the middle where everything is fine, but the corners will be a smeared mess.

Measure your document from corner to corner or use Pythagoras. This distance should be your document size to give buffer for not smearing pixels.

Let's say that your document is 512x512. The distance from corner to corner is approximately 725 (I rounded up just a tad).

Image > Canvas Size
Width: 725
Height: 725
Anchor in the center

Tada. Do your PC acrobatics and crop back down when done.

As far as I know, you won't hear this tip from anybody other than me. Because I rock. Stick that in your Bag o' Tricks. Yeah!