Why does my Virtual Reality World appear black when viewing a virtual reality scene defined in a VRML File using MATLAB?

1 view (last 30 days)
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)

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 27 Jun 2009
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"
}

More Answers (0)

Products


Release

R2006b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!