Skip to main content
GameDev.net gamedev.net
🔒 Locked

Texturing a Circle

Started by RipeTomatoe Feb 25, 2010 at 11:46 PM 0 replies 800+ views
Original Post
RipeTomatoe
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.
Zakwayda
Zakwayda
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.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.