- Home /
How to create a 2d interactive sprite planet?
My question is confusing me, so please, if you want to ask for clarification.
What I want to create is a planet as a 2d sprite that one can click drag to change view.
So let's I am talking about Earth. The view we have is both poles acting as the tip of the diameter of the planet, the equator being the center line. In this case GMT is the initial view. Now I want to look at China. To do so, I click the planet, and drag my mouse to the left. In doing this I shift the perspective of the planet to the left, and China scrolls into view.
Now to spice things up, the world we view is made up of pixels. Here is an example.
To get into the specifics, if I click drag to the left the view of the planet shifts left, and new pixels pop up on the right as ones on the left disappear to shift the view. The pixels in currently in view would move right to left. Would I create a coordinate system that knows which pixel to pull according to the current planetary position? And that user input shifts the view of the planet, causing the coordination system to refresh and pull the new pixels?
Answer by IndievdB · Sep 20, 2017 at 03:26 AM
There are a lot of ways of doing this.
You could get a looping, stretched image of the world like this one (except yours would be pixelated) then move the image left and right based on user input. You can add a circular sprite mask to make it look as if it is really a sphere that is rotating.
If you have the skills, you can animate the planet rotating 360, then scrub forwards and backwards in the animation based on player input. (If you don't have 2D skills you could create a 3D earth, render it rotating 360 degrees, then use some software to pixelate each frame.)
You could texture a 3D sphere to be your planet and pretend that it is 2D. This is probably best done by creating an unlit, pixelated shader. Then rotate the sphere based on player input.
Not sure which is best, but these are my ideas.
Your answer
![](https://koobas.hobune.stream/wayback/20220612135223im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Issue With Simultaneous ReadPixels Calls 0 Answers
How to create a "window" through a panel ? 0 Answers
AutoScale Orthographic Camera 1 Answer