Original Post
Hi, I'm trying to texture a sphere (representing a planet), by using cube maps. I think I understand the concepts fully, and have got it working, however I can't get the seams of the cube to match up properly. I'll try to demonstrate - here's a screenshot of my application; its just a sphere set to use the 'lobby.dds' taken from a DirectX 8.1 sample. I've highlighted the seam of the front cube face, to aid clarity.
Assuming that the sample cube map is correct (as it is taken from a Microsoft sample), the problem must surely be the texture coordinates. The sphere is centered at the origin, and I set the texture coordinates (a 3D unit vector 'uvr') equal to the position vector of the vertex (vector 'xyz'), for example: D3DXVECTOR3 uvr = xyz; Does anyone have any idea what the problem might be? Alternatively, would anyone mind posting any of their own code, on how to calculate the texture coordinates for each vertex? As always, your help is extremely appreciated. P.S. I've tried to keep the initial description brief, please ask if any code extracts would help.
Assuming that the sample cube map is correct (as it is taken from a Microsoft sample), the problem must surely be the texture coordinates. The sphere is centered at the origin, and I set the texture coordinates (a 3D unit vector 'uvr') equal to the position vector of the vertex (vector 'xyz'), for example: D3DXVECTOR3 uvr = xyz; Does anyone have any idea what the problem might be? Alternatively, would anyone mind posting any of their own code, on how to calculate the texture coordinates for each vertex? As always, your help is extremely appreciated. P.S. I've tried to keep the initial description brief, please ask if any code extracts would help.