I made a 3D chess set in CATIA, converted it to VRML format (.wrl), and will use it with an AI, GUI, etc. as part of a chess program. When converting to wrl, I cut down on the file size as much as CATIA would let me, so all circular objects are octagonal. The total file size of the board and the pieces is around 2MB. I incorporated a click and drag feature on the pieces, but for whatever reason, Matlab struggles mightily to render the chess set while moving the pieces. Movement is extremely choppy and rotating the set takes forever, even with navigation style set to "fast." However, when I used a web viewer for VRML objects, rendering the chess set was child's play for the web viewer. Movement was smooth, frame rates were high, etc. But not so when viewing it in Matlab. CPU usage (using Task Manager) was at around 30-50% when I moved a piece around. That's unacceptably high. The computer specs are: Dell Precision series, nVidia graphics, xeon processor, 4GB ram.
Anyway, why is this? I looked around on Mathworks for a possible cause, but no luck. I would appreciate any help, as this project is due in a few days. I tried everything, but to no effect.
No products are associated with this question.
Which Matlab version are you using? Which renderer is active? And if it is OpenGL, do you use the hardware or software rendering? How do you move and rotate the objects?
I do not have problems to display 21 spheres of 10*10 facettes and 25 cyclinders, a checkerboard floor and some 2D stuff with the hardware OpenGL renderer. This GIF is recorded with about half real-time on a PentiumM 1.5GHz, 512MB, a 16MB graphics card (a T40 IBM laptop), Matlab 2009a:
I can add further objects without reducing the fluently appearence. surface objects are drawn faster than patch objects. Therefore I assume your slow displaying is a problem of the VRML viewer in Matlab. Can you convert the objects to surface objects?
Does anybody else have an idea of how to fix this? Its quite urgent.
Although you repeatedly claim, that your project is urgent, you needed 3 days to tell us, that you use the "Simulink 3D animation internal viewer" to display the VRML file. Instead of this important detail, you explained details about your work with CATIA - a software or language I do not know and as far as I understand it is not relevant for the problem.
You said that 30-50% cpu load during moving a piece around is unacceptable high. Why? I would accept 100% or is a partially sleeping cpu important for your project? If so, why?
But let me summarize the already mentioned facts:
Then this conclusion is obvious: The Simulink 3D animation internal viewer is not sufficient for your project. This is not a fault of Matlab, you simply had wrong expectations and did not test this early enough.
I see two solutions:
I hope and think, that you have learned a lot from this project. Therefore I'm still convinced, that your problem is not "urgent". Wearing burning socks is an urgent problem. I have the impression, that you simply did not start to solve the problem early enough. Then repeating the project next term or year with more experiences is a valuable solution.
And for questions in this forum, other forums or scientific discussion, I repeat the suggestion to read and consider http://www.mathworks.com/matlabcentral/answers/6200-tutorial-how-to-ask-a-question-on-answers-and-get-a-fast-answer . A good question is succinct and requires no guessing for the answering.