Answer the question
In order to leave comments, you need to log in
Directx how to properly apply textures to a sphere?
Hello, there was such a question, how to impose textures on a sphere. The sphere is loaded from the .obj file, the u, v coordinates of the texture-.jpg are calculated based on the normal value. But there is an incorrect display - large pixels (attached a screenshot of the texture and its display). I will be grateful for any help.
vertices[i].TexCoord.f = 0.5f + atan2(normals[z], normals[x]) / (2 * pi);
vertices[i].TexCoord.f = 0.5f - asin(normals[y]) / pi;
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question