# Texturing a Circle

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

## 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 on other sites
Quote:
 Original post by RipeTomatoeOK, 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.

1. 1
2. 2
Rutin
19
3. 3
4. 4
khawk
14
5. 5
A4L
13

• 13
• 26
• 10
• 11
• 44
• ### Forum Statistics

• Total Topics
633743
• Total Posts
3013643
×