Well, this is more of a 2D than a 3D question, but anyways...
As part of a university project, I'm trying to transform a rectangular 2D surface into a circular surface.
Basically, I have a level (the game I want to do this with is Pingus, a Lemmings clone btw.), and want to wrap it around in a circle.
The way I do this right now is I segment the whole map from left to right into several large triangles, with the tips of all triangles at the top of the map, and the long sides on the bottom.
Naturally, all the space between the triangles won't be represented in the output then, but that's something I can fix in the game logic.
I then use the contents of these triangles as a texture to fill in a circle. Now, since the distance from the bottom to the top of each triangle is shortest in the middle, and longest at the outer edges, I throw away all the data that's "higher" than the height in the middle of the triangle.
All in all, this leads to a donut shaped form, which is perfectly acceptable. However, the perspective isn't quite correct. The pixels are more sheared than rotated. When I make a sketch and look at what happens with the texture coordinates I use, I can see why this happens, but I have no idea how to fix it.
Maybe anyone here has a nice idea, or even knows of a much better approach?
I'll attach a screen shot as soon as I get on my other PC
Thank you for any help.
As part of a university project, I'm trying to transform a rectangular 2D surface into a circular surface.
Basically, I have a level (the game I want to do this with is Pingus, a Lemmings clone btw.), and want to wrap it around in a circle.
The way I do this right now is I segment the whole map from left to right into several large triangles, with the tips of all triangles at the top of the map, and the long sides on the bottom.
Naturally, all the space between the triangles won't be represented in the output then, but that's something I can fix in the game logic.
I then use the contents of these triangles as a texture to fill in a circle. Now, since the distance from the bottom to the top of each triangle is shortest in the middle, and longest at the outer edges, I throw away all the data that's "higher" than the height in the middle of the triangle.
All in all, this leads to a donut shaped form, which is perfectly acceptable. However, the perspective isn't quite correct. The pixels are more sheared than rotated. When I make a sketch and look at what happens with the texture coordinates I use, I can see why this happens, but I have no idea how to fix it.
Maybe anyone here has a nice idea, or even knows of a much better approach?
I'll attach a screen shot as soon as I get on my other PC
Thank you for any help.