Hi,
I want to load an globe into my game. So, I created a sphere and loaded into the window,no problem up to here. I downloaded a world.jpg (map image) and try to apply the texture on to the sphere.
No result there in the window.
// texture variable
LPDIRECT3DTEXTURE9 d3dTexture = NULL;
and in the winMain function before the message loop,
D3DXCreateTextureFromFile( d3ddev, "world.jpg", &d3dTexture );
do i need to do anything more than this..where is the flaw?
regards,
aras
D3DXTexture
Your sphere will need to have texture coordinates, and you will need to activate the texture.
Could be any number of things...
If you don't know how to use an API try finding a tutorial or read the documentation before posting for help.
http://www.directxtutorial.com/
If you don't know how to use an API try finding a tutorial or read the documentation before posting for help.
http://www.directxtutorial.com/
Work through the examples in the SDK. Take note that DirectX functions give some sort of indication of success or failure. Check those error indications.
Avoid sites like www.directxtutorial.com that don't check error codes in their examples!
Avoid sites like www.directxtutorial.com that don't check error codes in their examples!
Check HRESULT values returned by every DirectX Function in your application, if any of them fails. Also you can check using some debugging tool (like Pix for Windows) values of Pre & Post VS vertices and see whether they include adequate texture corrdinates.
Also you didn't mention how you loaded the sphere , i mean importing from a X File or used D3DXCREATESPHERE function ?
D3DXCreateSphere doesn't create mesh with texture coordinates.
Again i am gonna agree with above replies go through DirectX SDK.
Also you didn't mention how you loaded the sphere , i mean importing from a X File or used D3DXCREATESPHERE function ?
D3DXCreateSphere doesn't create mesh with texture coordinates.
Again i am gonna agree with above replies go through DirectX SDK.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement