N
N
naka2122016-05-07 20:23:55
3D
naka212, 2016-05-07 20:23:55

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;
b57c34dfd48248289aa8bcc91dc2437e.pnga749594d2b2c4703b59afe2da96244ea.png

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question