Sign in to follow this  

Texturing a Circle

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

This topic is 2846 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this