WPF implements 3D models and 3D scenarios

Source: Internet
Author: User
Tags thread

1, the first point is that this is not true 3D, the model is exported to a series of single pictures, such as a 3D house chart, with a point of view to rotate 360 °, rendering a series of consecutive single picture files.

2, in the Image.mousemove event to add the appropriate code, according to the direction of the move (according to the current mouse point and the previous mouse point can be judged) to update the Image.source (assigned to the previous or next picture)

3, if it goes well, then you can rotate your 3D model smoothly.

However, the development of things often makes people very unpleasant.

As a start, all kinds of network search. Omit a variety of exotic ideas, such as asynchronous loading, preload, and so on.

1. Change time in space. Use list<byte[]>/list<stream> to preload all the pictures into memory 400 1.27M (1024*768 jpg) theoretically 400*1.27=508m But in fact the memory footprint reached more than 1300 m (I do not know why so much)! However, space occupied the time but did not change, cotton as usual!

2, or in space to change time, but this time using list<imagesource> to cache all the pictures. But the truth is still sad! But fortunately, this time let me find the crux of the problem, is the image of the present! If the imagesource is rendered, it will speed up a lot faster to assign the value to the image program! Here are some of my tests:

400 pictures of about 1.27M, memory footprint of more than 1360 m, the first rendering needs 35ms or so, after the rendering takes about 15ms.

400 pictures of about 860K, memory footprint of more than 1300 m, rendering time of about 30ms after the rendering time is about 15MS

This column more highlights: http://www.bianceng.cnhttp://www.bianceng.cn/Programming/net/

400 pictures of about 620K, memory footprint of more than 880 m, rendering time is about 20ms, after the rendering of 15ms or so (in turn, all the picture theory is time-consuming: 20*400=8000ms actual time consuming: 1200+ms)

400 500K pictures, memory footprint of more than 700 m, rendering time is about 15ms, the first presentation that can be smooth rotation, but the picture is not clear enough!

Note: I use the machine: win8.0, i5 3.0Ghz, Memory 8G, graphics card GTX Ti

Two key issues:

1, how to reduce the rendering time consuming (my current practice is to use a dynamic loading picture, with a thread to render all the ImageSource in turn)

2, reduce memory footprint (I try to save only the first and last 10 ImageSource of the current index, memory footprint is down, but no cache effect, may be my thread scheduling problem)

About WPF for control rendering, a variety of Baidu, what the principle of the structure of the map to see a bunch of solutions to point to a sad direction: CPU, Memory, graphics card!

But, as I said before, the facts tend to make people more hurt, the budget of equipment ... This, we all understand it.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.