texture on mesh.sphere doesnt move?
i have a spinning mesh.sphere and a texture applied to it, and the mesh spins fine, but the texture doesnt seem to move for some reason.
heres bits from the code that are relevant
--
ball.Radius = 0.6f;
ball.Mesh =
Mesh.Sphere(dev, ball.Radius, 50, 50);ball.Texture =
TextureLoader.FromFile(dev,"banana.bmp");dev.SetTexture(0, ball.Texture);
ball.Mesh.DrawSubset(0);id appreciate help on this as its befudled me :(
I'm not sure if this is the problem, but I know from texture experience in Maya and other 3D packages that if a texture isn't moving with its mesh, then the projection of the texture onto the mesh isn't locked. This means that as the mesh moves, the projection stays still.
See if there's any way to tell the texture projection to bake UVs onto the mesh, or lock the projector to the object.
If Mesh.Sphere() is functionally the same as D3DXCreateSphere() then you wont get texture coordinates. It creates your geometry using position and normal only.
Texturing a sphere is non-trivial (a few awkward cases at the poles to be careful of for example), but you'll have to do it yourself. You might be able to use the UV Atlas parts of D3DX to generate it for you.
hth
Jack