Jump to content

Bend sprites around a point ?


Exx2xxO
 Share

Recommended Posts

Hey everyone !

 

So if you didn't get the title's hint  :D : Is there a way to bend, fisheye like, straight sprites around a given Point so it appears to be round? The Problem I'm facing is:

 

I want to generate a more or less random planet surface, but for that I want to use a tile set so I can just put them in a row like a plain area and then with some magic *pow* --> a planet...

 

...well maybe not magic but some phaser power :D So is there a way to trick the player with some fisheye camera technique or some sprite bending power?

 

Thanks :)

 

Exx

Link to comment
Share on other sites

You're going to build a sprite as bitmap data, looping through the different bands and save it to the cache and then apply some maths to it and make it into a sphere. 

You can do that the hard way (like finding an external library) or by just writing a stupid approximation — like looping through columns to make each pixel column a different height to create the illusion of a bulge? Then you'd save it as a sprite.

I found some stuff that might give you an idea of the differences between the easy and hard way.

http://stackoverflow.com/questions/1927145/how-to-simulate-fisheye-lens-effect-by-opencv
http://www.user00.com/my2iu/workshop/fisheye/fisheye.html

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...