• Advertisement
Sign in to follow this  

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;
        }
    }
	

Share this post


Link to post
Share on other sites
Advertisement

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this  

  • Advertisement