Thanks Ant,
I got some C++ code, I think this will do the job. Tell me if I'm wrong.
I got some C++ code, I think this will do the job. Tell me if I'm wrong.
// determine extents D3DXVECTOR3 vMin,vMax; D3DXComputeBoundingBox(pVerts,numVerts,FVF_VERTEX,&vMin,&vMax); // calculate center D3DXVECTOR3 vCent; vCent=(vMax+vMin)*0.5f; // loop through the vertices for (i=0;i<numVerts;i++) { // calculate normalized offset from center D3DXVECTOR3 v; v=pVerts->pos-vCent; D3DXVec3Normalize(&v,&v); // calculate texture coordinates pVerts->tu=asinf(v.x)/D3DX_PI+0.5f; pVerts->tv=asinf(v.y)/D3DX_PI+0.5f; // go to next vertex pVerts++; }