Jump to content
  • Advertisement
Sign in to follow this  
RipeTomatoe

Texturing a Circle

This topic is 3040 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

OK, this should be a quick answer, but I need to texture a circle (home made coding a circle) if you need I can post how I do it, but it's really math intensive and I don't want to scare people. Also I need to know how to rotate it (once again HOME MADE ROTATE, none of that glRotatef crap) when need be. thanks in advance for all the help.

Share this post


Link to post
Share on other sites
Advertisement
Quote:
Original post by RipeTomatoe
OK, this should be a quick answer, but I need to texture a circle (home made coding a circle) if you need I can post how I do it, but it's really math intensive and I don't want to scare people. Also I need to know how to rotate it (once again HOME MADE ROTATE, none of that glRotatef crap) when need be.

thanks in advance for all the help.
Is this a homework problem by any chance?

I think you could go ahead and post your code (be sure to use [ source ] tags). The math for generating the geometry for a circle and transforming it manually isn't really that intensive :)

For generating texture coordinates (which I assume is what you're asking about), the easiest solution would probably be a simple planar mapping. For example, if the circle lies in the xy plane in local space, the u and v coordinates would be a simple linear mapping of the vertex x and y coordinates from one range to another.

For rotating the circle, the most straightforward solution would probably be to build a transform matrix representing the rotation, and then apply it to each vertex of the circle in turn.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

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

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!