# Looking for a great way to map a skydome?

## Recommended Posts

This way when the sky is animated, it looks like the cyclone blowing off one way and sucking into the other way. Second problem is the sky seems too small when the dome radius is 11000m long,  it is already 11km long. And also the texture looks a bit blurry, the texture size is 1280x720..

	if (SUCCEEDED(texMesh->LockVertexBuffer(0, (void**)&pVerts)))
{
std::vector<D3DXVECTOR3> poses;

int numVerts = texMesh->GetNumVertices();

for (int i = 0; i < numVerts; i++)
{
poses.push_back(pVerts.pos);
}
D3DXVECTOR3 vMin, vMax;
D3DXComputeBoundingBox(&poses[0], numVerts, sizeof(D3DXVECTOR3) , &vMin, &vMax);
D3DXVECTOR3 vCent;
vCent = (vMax+vMin)*0.5f;

for (int i = 0; i < numVerts; i++)
{
D3DXVECTOR3 v;
v = pVerts.pos - vCent;
D3DXVec3Normalize(&v, &v);

pVerts.norm = v;
pVerts.tu = asinf(v.x)/D3DX_PI+0.5f;
pVerts.tv = asinf(v.y)/D3DX_PI+0.5f;
}
}


## Create an account

Register a new account

• 9
• 13
• 40
• 15
• 11