Sphere perfect texturing. Here’s some samples. [Committed]

madjack said:
I take it you tested it?

Yep i did, works like a charm ;)
nehon said:
Yep i did, works like a charm ;)

I'm happy then. The code works after being committed and I haven't broken anything. ;)

@nehon or anyone that can verify this…



It seems either there was a change somewhere or my jMP got screwed up somehow, but I can’t save new textures when using the Texture Editor, nor are the tooltips I had put there displaying anymore.



Can anyone verify this please?

mhhh true, I have the same issue…

I don’t think something changed in the textureEditor though…

Could you please open an issue in the tracker?

i’ll look into it

Done. Thanks.

http://code.google.com/p/jmonkeyengine/issues/detail?id=385

Should be fixed in next update

Well I tried this with tileable 512x512 texture and Sphere isn’t really textured so beautifully. There is still a visible line on one side of the sphere. Please see attached image.

http://i.imgur.com/AJJwW.png

Any idea how to fix this or sphere cannot really be mapped ideally?

Yeah. I realized this much later after posting the code but haven’t had the time to properly look for an alternative.



If you do have the time, I think the original author (the link is in the code) has a fix for that but if there is, you’ll have to adapt it to Java.



I will eventually get into it but right now I don’t have the time for it.

Thanks for your answer! :slight_smile:

Anyway, am I the only one who is unable to use this in JDK? Or is just JDK so anti-intuitive? I created special class and copied your code into it, to test it … Doh. :slight_smile:

@InShadow said:
Anyway, am I the only one who is unable to use this in JDK? Or is just JDK so anti-intuitive? I created special class and copied your code into it, to test it ... Doh. :)


The way to use it is by using an image and applying the "filter" to it in the JDK. Should be straightforward.

Going by memory... Open the image in JDK. In the menu right above the image click on Filters then select the Sphere (or whatever it's named). That should open a copy of the original image with the filter applied. After that it's only a matter of saving the new file.

Edit:
Also make sure the texture alignment is proper. If you're not sure try it the way it already is. Or rotate the image then apply the filter. Note that texture resolution is important. I wouldn't go below 1024x1024, but that depends on the size of the spheres you're applying it to.