In fact, before looking at the author’s article, you can search on the Internet under the 3D Max model into the WPF approach, most of the results are this article. What about this article? It’s a bit of a hassle, but when we convert our 3D Max model to Blend, only the model has no texture and texture, and needs to be in Ble.Nd3 adds its own texture map. Simple model added in Blend is OK, complex point, it is troublesome, I do not want to directly use Blend modeling it! There is also a point I think the use of buttons to control the aircraft is too troublesome, you can use the mouse to control the aircraft ah. So this article is mainly around.These two points are written.
Download of this example (development environment: 3ds Max 9, Microsoft Expression Blend 3, VS 2010)
The 3D Max model in this article refers directly to WXWinter, but in 3D Max I provide the material maps (file: helicopter. max) directly to the aircraft. Open the 3Dmax model, click the file ==>, export the ==>, and save the type.Obj). Then set it down according to the picture below and click OK.
Got two files (.Obj and.Mtl).
Then you open Microsoft Expression Blend 3, create a new WPF program, and in the program, select project = & gt; Add Existion Item (select the two files above and fly)Material maps A. JPG and B. jpg, add them to the project, and then double-click the. obj file in the project, the aircraft will automatically display in the Main Window window, where you can resize the model, and so on. This successfully generated the 3Dmax model.Data is converted to data in Xaml format.
Open the project just created by Blend with vs, because the author used vs2010, so there will be code conversion problems. After converting the code, double-click the MainWindow. Xaml file, and you can see that the 3D Max aircraft model was successfully entered into the WPF.
Believe that the following is simple to add mouse events to Gird (MouseWheel, MouseLeft Button Down, MouseLeft Button Up, etc.). Then is the specific operation of the 3D object, Viewport3DBread contains 3D content. Viewport 3D. Camera is like a video camera showing 3D objects in 2D form. It’s like watching TV. It’s true 3D. It’s actually a 2D plane. This property is very important, its Position attribute.The LookDirection attribute and the UpDirection attribute directly affect the presentation of the 3D content that is viewed. Here you can scroll the button in the middle of the mouse to trigger the MouseWheel event, change the camera position, and move in the direction of Look DirectionIn this way, people feel that objects are getting bigger or smaller.
In this case, the operation of the aircraft, rolling pulley forward or backward, holding the left key and moving the mouse is left, right, holding the right mouse is rotating the aircraft.