سؤال

I'm using OpenGL to develop a 2D game. and I'm trying to map a texture around a circle, as shown on image below. I have noticed that many games have used this technique because it can save the size of texture resources.

But I don't know which texture mapping technique it used. Any suggestions?

enter image description here

هل كانت مفيدة؟

المحلول

Just like pointed out by genpfault.

Create a bunch of Quads along two circles. Set their UV coordinates A, B, C, D like shown in the picture. To get the point C, just add the distance h to the Vector Center -> B

PS: you will need a lot more quads then i drew

description

نصائح أخرى

Generate a donut of quads with appropriate texture coordinates.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top