Jump to content
  • Advertisement

Archived

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

tanissian

Texture mapping for a sphere

This topic is 5459 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
Advertisement
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
From tutorial 18 from NEHE, it seems quite easy to texture quadrics. However, how do we change the texture coordinates of a quadric? If we want to increase the number of tiles?

Thanks!

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

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!