MATLAB: Does the Virtual Reality World appear black when viewing a virtual reality scene defined in a VRML File using MATLAB

blankbuilderlanguagemodelingrealitySimulink 3D Animationstrangev-realmvirtualweird

I have a Virtual Reality world defined and able to be viewed in other VR viewers. However, when I perform the following, I only see a black screen.
myworld=vrworld('JuliaVello103106RDCopoly.wrl');
vrwhos
open(myworld)
set(myworld, 'Description', 'My first virtual World');
view(myworld)

Best Answer

If no viewpoint is defined in the VRML file then the internal viewer uses the default viewpoint at position [0 0 10], which may lie inside the object.
IndexedFaceSets are by default single-sided objects; they are transparent from the other side - so it is correct that there is nothing displayed.
blaxxun Contact (which is a VRML plug-in for either Microsoft Internet Explorer or Netscape Navigator on the Windows platform) has an intelligent system of setting the initial viewpoint when there is no viewpoint defined, so it displays the object as expected.
As a workaround, it is always recommended to define proper viewpoints, to ensure that the world user sees what the world author intended. If you place the following code at the beginning of the VRML file, then the object will be seen in the view where x, y and z are positions for the viewpoint:
Viewpoint
{
position x y z
description "View 1"
}