Archived

This topic is now archived and is closed to further replies.

Texture mapping for a sphere

This topic is 5150 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi, I am having trouble mapping texture onto a sphere. The sphere data is read in from a file, and I have the following to calculate the coordinates:
float u=0, v=0;
v=acos(z/radius)/PI;
if(y>0) u=acos(x/(radius*sin(PI*(v))))/TWOPI;
else u=(PI+acos(x/(radius*sin(PI*(v)))))/TWOPI; 
This is what I got, can someone help me on this plz? Thanks. http://www.eq2cn.com/image/jupiter.jpg [edited by - tanissian on November 8, 2003 6:26:50 PM]

Share this post


Link to post
Share on other sites
If it''s a true sphere (ie, it''s a perfect sphere, no bulge at the equator) then i would suggest just using Quadrics, cuz they can generate their own tex coords.

Share this post


Link to post
Share on other sites
quote:
Original post by Dragon88
If it''s a true sphere (ie, it''s a perfect sphere, no bulge at the equator) then i would suggest just using Quadrics, cuz they can generate their own tex coords.




Thx for the reply, but I have to use the points specified in the file.

Share this post


Link to post
Share on other sites
DIE quadrics DIE,

use your own model, check out a skydome tutorial (google) and you''ll find out how to gen texcoords for a sphere.



[ My Site ]
All your source are belong to us
/*ilici*/

Share this post


Link to post
Share on other sites