Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

spherical texture mapping

Caoimhe Armitage
Script Witch
Join date: 7 Sep 2004
Posts: 117
04-19-2005 10:13
ok, I'm stuck. How do textures get mapped onto the surface of a sphere in mathematical terms? I have some maps I'd like to put on a globe. The maps are already conically projected onto textures, so I need some way to transform those conical projections to something that will map nicely onto a sphere.

ANy ideas? Or is this just too mathematical?

- C
Jack Digeridoo
machinimaniac
Join date: 29 Jul 2003
Posts: 1,170
04-19-2005 10:32
If you have 6 square textures that you want to map to a spherical texture this might work. The tutorial was originally created to texture the inside of spheres but it should work fine on the outside.

Basically you need PTStitch

PTStitch needs the following script to run:

CODE

p w2048 h1024 f2 v360 u0 n"TIFF"

o f0 y0 r0 p0 v90
o f0 y90 r0 p0 v90
o f0 y-180 r0 p0 v90
o f0 y-90 r0 p0 v90
o f0 y0 r0 p90 v90
o f0 y0 r0 p-90 v90


Put it in a file called "cube2sphere.txt". Then you need to run ptstitch :

ptstitcher -o mysphere cube2sphere.txt
front.bmp left.bmp back.bmp right.bmp top.bmp bottom.bmp
_____________________
If you'll excuse me, it's, it's time to make the world safe for democracy.
Caoimhe Armitage
Script Witch
Join date: 7 Sep 2004
Posts: 117
04-19-2005 10:40
From: Jack Digeridoo
If you have 6 square textures that you want to map to a spherical texture


Sorry, no. I have square textures, each of which contains a circular conical projection of a spherical map. I think it's the conjugate problem to what you mention...

- C
Upshaw Underhill
Techno-Hobbit
Join date: 13 Mar 2003
Posts: 293
04-19-2005 20:52
I just happened to be looking for this myself and knew there was an older post with a tutorial.

Thanks again to Spider Mandala!

L8r,
UU

P.S. not sure if this will help you unless you can get back to a flatter version perhaps.
_____________________
Chosen Few
Alpha Channel Slave
Join date: 16 Jan 2004
Posts: 7,496
04-20-2005 13:37
From: Upshaw Underhill
I just happened to be looking for this myself and knew there was an older post with a tutorial.

Thanks again to Spider Mandala!

L8r,
UU

P.S. not sure if this will help you unless you can get back to a flatter version perhaps.

As I said in my reply to this exact same thread in the texture forum (not sure why it was cross-posted), the polar coordinates filter is not incredibly reliable. It only works if you have a relatively uniform texture that you don't mind losing pieces of, like that denim texture in Spider's tutorial. For something like a picture though, it's extremely impractical. As I've said before, if you use that filter to wrap a map around a globe, you will end up losing a continent or two in the process.

The problem is Photoshop has no idea what a sphere is. It can only think in two dimensions, so it has to guess at what's going to happen in 3, and it doesn't do a very good job of it. It cuts out entire sections of the image to try to force fit the rest of it together.

You're much better off doing what what Cao is doing, which is trying to understand how the texture wraps so you can adjust your images to compensate.
_____________________
.

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.