I can't seem to get a texture on a sphere that doesn't have painfully obvious distortions.
Take an repeatable image in GIMP let's say…1024 x 512, apply polar coordinates distortions (fix any oddities), then apply to a jME sphere. The texture doesn't look right, whilst applying the same texture to a sphere in Blender looks OK.
How should I attack this problem?
Sphere has two different texture mappings, did you try them both? If yes, can you figure out what's different to blenders mapping?
A simple workaround: export a sphere from blender
Yes I've tried both mappings. I tried geosphere and compositesphere (looked like a whiffle ball) with no luck as well.
The sphere in Blender uses the top and bottom of the picture for the poles whilst the jME sphere doesn't appear to be doing so. I'm not sure how to describe it. If I have time after work I'll try and get some screens posted.
irrisor said:
A simple workaround: export a sphere from blender :)
First I'll try rolling my own sphere - until that gets too frustrating ;)
One reason for the distortion is there is only one point at the poles, so only one texture coordinate is possible, so all the points on the ring around the pole vertex are forced to interpolate bewteen their uv and a single corner of the texture. What would help would be to add more points at the pole vertex with a full range of uvs.
I’ve been blessed with a brief moment of calm after my raging fit of laughter just moments ago - I shall take advantage of this opportunity to make my report.
IT STARTED OFF OK
I spent most of the evening looking at notes and code posted on this page about Aasgard’s map projection which says:
* It maps the whole earth into a rectangle of finite size.
* Shape is approximately preserved over allmost the whole earth.
* The scale increases to a very large value towards the poles.
* The polar points (the north and south pole) are mapped to a line (the upper and lower edge of the rectangle).
* The meridians are mapped as vertical lines.
* The paralells are mapped as horizontal lines.
* The equations are very simple.
Sounds neat! Unfortunately I'm currently too stupid to fully grasp what he's talking about in his PDF and example code. I hope to raise my INT when I level up. (Could the DM please tell me how much more XP I need???)
I next ventured over into the land of celestia.sf.net cvs because of page on libnoise about generating noisy polar distorted things that come out looking like nice planets in aforementioned Celestia. I tried looking at their code in spheremesh.cpp and adding it to a modified jME sphere... I had a few odd looking results that ultimately ended in failure. I think their sphere is made of quads anyway, and we all know you can't put quad blocks in sphere holes... <sound effect>
MEANWHILE, BACK IN BLENDER CITY
UV Spheres and ICO Spheres were being created... and exported...and not working...and changing and exporting and not working, and uv mapped and exported and not working well, and hand-edited xml and not working, and take a moment to breathe and not working, and changed around again and exported and not working, until i died... Not really. I stopped before that happened. Fooled you for a minute though?
I decided to seek advice from a ninja master. Unfortunately all his suggestions ended with me killing the spheres. Tempting as that was I decided against that course of action, and proceeded to consult Google on the matter of "uvmap spheres" (whatever that means). Google responded with an assortment of web pages, the fourth one being this innocent looking forum discussion where my attention was brought to UVMapper - a stand-alone texture mapping utility for the creation and modification of UV coordinates for n-sided polygonal 3D models.
By now you may be wondering why I took the time to tell you all of what you may or may not have read. Go ahead. Ready...? It's bec~ause (pause for effect) if you'd like a sphere that you can put polar distorted and artifact corrected textures on, it takes about 10 seconds depending on how fast you can:
1) Download, unzip, and start UVMapper Classic...
2) Click File -> New Model -> Sphere
3) Fill in what you'd like for radius, vertical divisions, radial divisions, leave the "gap" checkbox unchecked, click "OK"
4) Click File -> Save Model, click "OK" on the export options, give it a filename to save as, click "OK".
5) Load the OBJ model in your jME app.
6) Wish you could get back the time you just wasted...
Oh wait! that last step is just me! :cry:
Unless you count the time you spent reading this post. :evil: