Skip to main content
GameDev.net gamedev.net
🔒 Locked

Texturing a semicircle

Started by glHomeless Mar 30, 2007 at 4:50 AM 1 replies 1.1k views
Original Post
glHomeless
glHomeless
Hi, I have a texture of a sky and I want it on a semicircle. But my problem is, that my texture is quadratic. How to make it on a sphere? Please help me out! Thanks for any help
Omid Ghavami
Omid Ghavami
There are ofcourse several ways of doing this. I can't tell if this is a graphically good way or not, but one option is to imagine your texure as a plane with the semi-circle on top of it, as if the plane had cut the sphere in half. And then project each pixel on the plane through a straight vertical line to the corresponding points on the semi-sphere above that point.

Another option would be to use stereographic projection, which basically means to project each point on the plane to the point of intersection of a straight line, from a virtual southern pole (virtual since it's non-existing when you have a semi-sphere) through the point of interest on the plane, and the semi-cirle.
Best regards, Omid
glHomeless
glHomeless
thanks. I will implement the first one.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.