How to project a 2D image on its 3D surface?
-
Sunday, September 04, 2011 3:34 PM
I have a 2D image and the suitable 3D model for it. And now I want to construct a 3D image.
For excample the result should look similar to this.
Is there any way to do this with WPF? Thanks in advance.
- Edited by 313371 Sunday, September 04, 2011 5:59 PM
All Replies
-
Tuesday, September 06, 2011 3:47 AMModerator
Yes, WPF has the way to do it, but it is very very complex if you want to put the above image on the 3D object. We call it "stick texture" on the 3D model.
For example, we have a simple 3D surface, we want to stick one image on it, we have to do the following steps:
1. Split the surface to some triangles. Mark the points of these triangles as the index:
2. Map the points on this 3D surface to the points on the 2D image by its index:
3. You will view the 2D image on the 3D object as its texture.
This is a very simple texture sample. But your scenario is too complex and can be done manually. Please try to use the 3D building tools like 3D Max Studio, Blender or ZAM3D etc., then export the 3D models to XAML code.
More about the 3D basic in WPF, please view:
- http://www.codeproject.com/KB/dotnet/3D_in_XAML.aspx
- http://kindohm.com/technical/WPF3DTutorial.htm
- http://www.wpftutorial.net/IntroductionTo3D.html
- http://msdn.microsoft.com/en-us/library/ms747437.aspx
And for 3D texture in WPF: http://www.devx.com/dotnet/Article/42450
Sincerely,
----------------------------------------------
This response contains a reference to a third party World Wide Web site. Microsoft is providing this information as a convenience to you. Microsoft does not control these sites and has not tested any software or information found on these sites; therefore, Microsoft cannot make any representations regarding the quality, safety, or suitability of any software or information found there. There are inherent dangers in the use of any software found on the Internet, and Microsoft cautions you to make sure that you completely understand the risk before retrieving any software from the Internet.
Bob Bao [MSFT]
MSDN Community Support | Feedback to us
Get or Request Code Sample from Microsoft
Please remember to mark the replies as answers if they help and unmark them if they provide no help.

- Marked As Answer by Bob_BaoMVP, Moderator Monday, September 12, 2011 8:05 AM
-
Tuesday, September 06, 2011 8:25 AMThank you very much for the reply. I will take a look at this.
-
Monday, September 12, 2011 7:52 PMI ended up using directx for this problem.

