Texture map to 3d head model

Hi

I want to map the 2D human face image as a texture on

3d head model in managed DirectX. Can Anyone help me on this problem?
I have already tried TextureLoader.FromFile(...) Method
but it didnt work. This method put some dark shade on 3d model
and nothing else. I want to map the image from file on 3d head model.
How this would be done?
thnx
[433 byte] By [ursfriend] at [2008-1-12]
# 1
It's very hard to do programmatically. Your best bet is to use a modeling program like Blender to create your model. Export it to an .X file & you won't have to do anything but load that .X file.
Minh at 2007-9-9 > top of Msdn Tech,Game Technologies: DirectX, XNA, XACT, etc.,Game Technologies: Graphics...
# 2
You will need to have valid texture coordinates defined for your mesh before you can get correct texturing. Just loading a texture won't do this - and is probably why you saw "some dark shade on 3d model".
As the previous reply said, the best/easiest way of creating a correct mapping is to use a 3D modelling tool to generate your head mesh with texture coordinates. Save it from your modeller, and then import this into Direct3D via the usual methods...
Alternatively, you might want to look into the "UVAtlas" components that appeared as part of D3DX in recent SDK refreshes. It'll require a fair bit of work on your part, but is probably as close as you can get for generating the mapping using just source code.
hth
Jack
JackHoxley at 2007-9-9 > top of Msdn Tech,Game Technologies: DirectX, XNA, XACT, etc.,Game Technologies: Graphics...
# 3
thnx for ur response...Actually I want to do 3d Reconstruction of human head
So I have to map different texture each time I use different face picture and I cant use modelling program. I have to do it in program.

I have also tried by setting individual Texture Coordinates(tu, tv). I did this as follows......Load the mesh(.x file). Then Lock the mesh by 'LockVertexBuffer' method, access its vertices as 'CustomVertex.PositionNormalTextured' and then set its Texture Coordinates but it doesnt work for me.

Can you tell me something in managed directX since I am using c# for my program.

ursfriend at 2007-9-9 > top of Msdn Tech,Game Technologies: DirectX, XNA, XACT, etc.,Game Technologies: Graphics...
# 4
How about creating a "reference" head in a 3D modeler & just swap out different textures when you switch the face bitmaps?
Minh at 2007-9-9 > top of Msdn Tech,Game Technologies: DirectX, XNA, XACT, etc.,Game Technologies: Graphics...
# 5
I dont think it works...bcz it not look logical and also its not possible. Besides this the requirement of my program is to do it in application myself. Please tell me How to do it using managed Directx
ursfriend at 2007-9-9 > top of Msdn Tech,Game Technologies: DirectX, XNA, XACT, etc.,Game Technologies: Graphics...
# 6
What you are looking for requires a very non-trivial application. Best advice I can offer you is to find a development house that specializes in medical application development.
DavidWeller at 2007-9-9 > top of Msdn Tech,Game Technologies: DirectX, XNA, XACT, etc.,Game Technologies: Graphics...