Is it possible to efficiently simulate (aka compute) what a texture (simple 2D) image rendered on a sphere and seen from a certain, constant position directly facing the sphere, will look like?

Am looking for an efficient method to achieve a 3D effect based on an image without launching a whole 3D scene and render 3D polygons etc. (mainly because the device does not have hardware acceleration for that).

The effect does not have to be strong (in the end only a part of the sphere would be visible) and not perfect either (target resolution of 128x128. It may (would most likely require) rendering 2D polygons.

Could someone direct me towards the right algorithms? Huge thanks in advance!

  • $\begingroup$ Similar to the rotating planet animation in Star Control 2? $\endgroup$ – Nominal Animal Dec 11 '17 at 11:36
  • $\begingroup$ @Nominal Animal Wow, didn't expect an answer anymore. Thank you! Yes, that's quite neat and what I thought at. Just am not sure how well that method works if the texture has a less consistent structure and for example shows an eye with a pupil. However in the meantime I've got a fairly satisfying solution myself pretty much by just throwing math at it for half a day, haha. Will show the result and code some day soon. $\endgroup$ – DragonGamer Dec 11 '17 at 13:35
  • $\begingroup$ It is actually very simple to do exactly correctly, if the axis of rotation is horizontal or vertical: each latitude is mapped as a single strip of pixels, using quite simple fixed-point math. If the axis of rotation is tilted, usually a look-up table is used. Arbitrary rotation is trickier, but doable, too. $\endgroup$ – Nominal Animal Dec 11 '17 at 16:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.