I need to create a sphere with polar coordinates for texture coordinates. This means I expect to gain two angles at least.
I’ve been debugging the coordinate values that TextureMode.Polar creates for a longer time now and I’ve also looked into the code. I’ve come to the conclusion that the coordinates, that TextureMode.Polar creates, are not polar at all, but some sort of Cartesian?!
In Sphere.java, the vertex locations are created like:
From the code it seems that TextureMode.Polar has nothing to do with “polar coordinates” and instead refers to a form of mapping that shows the texture undistorted when viewed from the poles.
…for example, if you were trying to map a polar view image of the earth to a sphere.
I think it’s about what you expect ‘texture mode’ means. If you take it to mean ‘texture projection’ I don’t think polar coordinates is what is expected when talking about ‘polar’.
Some popular projections are: ‘Planar’, ‘Box’, ‘Lollipop’, ‘Cylindrical’ - the names shouldn’t lead you to expect ‘Lollipop-coordinates’ any more than ‘polar coordinates’
Indeed, but then TextureMode isn’t self-explanatory enough, especially from a shader authoring point of view, neither is the documentation clear on this point. In fact one has to dig into the code to get clarity. Maybe TextureProjection would be better.
The description could probably be improved… but the current one does actually say what it’s doing:
“Apply texture to each pole. Eliminates polar distortion,
but mirrors the texture across the equator.”
It never mentions “coordinates” at all. And just to be clear, other PolarXXX things that it doesn’t mention and that are also not relevant:
Bear
IceCaps
Opposites
Vortex
Express