MATLAB: Do I receive an error when viewing a large .wrl file in Virtual Reality Toolbox 4.5 (R2007a)

.wrlcatiarealitySimulink 3D Animationvirtualvrml

When I open a very large .wrl file exported from Catia I receive the following error:
??? Unexpected Standard exception from MEX file.
What() is:bad allocation
Error in ==> vrfigure.vrfigure at 75
f(i).handle = vrsfunc('VRT3ViewScene', get(world(i), 'id'), pos{i});
Error in ==> vrworld.view at 44
x = vrfigure(w);
Error in ==> M276 at 5
view(world);

Best Answer

There is no direct relation between WRL file size and the amount of memory
needed to process that file. It is not possible to determine how much memory a VRML world needs without seeing its WRL file.
As a workaround, either of the following steps could be implemented:
1) To have more memory available, use a 64-bit version of MATLAB and VR Toolbox (either on Linux or on Windows).
2) A more preferable alternative is to tweak the parameters of Catia VRML export to obtain a much simpler VRML file. Tools like Catia often tend to export in great level of detail that is not even renderable, and reducing the complexity significantly reduces memory requirements while losing very little rendering quality.