Jan

I tested the latest vrml plugin on some larger files, real vrml files rather 
than the little test files that I sent you before.  I tested them with both 
osgviewer and vrNav2, my own program.   First, the problem with 
osgUtil::SceneView crashing in draw(  ) that I had before when I loaded the 
vrml files with vrNav2 is now gone, so that's good.  I notice, from looking at 
the resultant .osg files, that the vrml translation is introducing a rotation 
to turn the z of the model up.  vrNav2 already does that for all models so I 
added a test there not to do it for .wrl models it loads.  The first few 
models that I loaded worked fine.  Then I ran into a problem.  The problem 
seems to be related to the size or the number of Shapes in the vrml file. 
Also, it may be some kind of timing problem (in it taking too long to load the 
model).

The problem manifests itself as follows: in osgviewr, the graphics screen 
comes up as a black screen and then turns into a screen with a blue background 
and the model appears.  With the ones that don't work, the screen remains 
black and you don't see the model. With vrNav2, vrjuggler is opening for me 
(using X Windows calls) a black graphics screen of size 640 by 480.  With the 
ones that don't work, I get a black graphics screen that fills the whole 
screen (not 640 x 480) and no model.  When it works, I get my 640 x 480 
graphics screen.  vrNav2 writes out the model's bounding box dimensions 
immediately after loading the model and this always happens.   Also, if I 
change the vrNav2 code so that immediately after loading the model it writes 
out the model in .osg format, the problem is gone and the program work and the 
problem.  But if immediately after loading the model, I just add some sleep, I 
am back to it not working.

If I take a model that doesnt work but which has multiple Shapes, and divide 
it into .wrl files each with a single shape and load just a single Shape, it 
always works.  I can also take subsets of the Shapes and have it work.

Here are 4 models: 

    waves.wrl   with 3 Shapes 3406099 bytes
    isos2_2.wrl with 2 Shapes  883264 bytes
    sigmoid.wrl with 6 Shapes  326260 bytes
    vectors.wrl with 8 Shapes 3234335 bytes

>From them I constructed the following: sigmoid1.wrl the first Shape from 
sigmoid.wrl, sigmoid2.wrl the second Shape, ... sigmoid6.wrl the sixth Shape,
sigmoid1-3.wrl the first three Shapes, sigmoid1-4.wrl the first 4 shapes, 
sigmoid1-5.wrl the first 5 Shapes.  vectors1-4.wrl the first 4 Shapes from 
vectors.wrl, vectors1-5.wrl and vectors5-8.wrl etc.  waves1.wrl the first 
Shape from waves.wrl, also waves2.wrl, waves3.wrl and waves1-2.wrl.

Here are the results:

   model                     vrNav           osgviewer
   ----------------------------------------------------
   sigmoid                   black screen    black screen
   any of sigmoid1 through
     sigmoid6                works           works
   sigmoid1-3                works           works
   sigmoid1-4                works           black screen
   sigmoid1-5                black screen    black screen

   isos2_2                   works           works
   
   waves                     black screen    works
   waves1                    black screen    works
   waves2                    works           works
   waves3                    works           works
   waves1-2                  black screen    black screen

   vectors                   black screen    works
   vectors1-4                works           works
   vectors1-5                black screen    works
   vectors5-8                works           works

Anyway, I am not unhappy with this situation.  My goal is to be able to take 
vrml 2.0 files output by scientific visualization programs and turn them into 
models that can be loaded.  I can easily do this by following this procedure:

   osconv whatever.wrl whatever.osg
   edit whatever.osg and remove the matrix transform at the top
   osconv whatever.osg whatever.ive

Then I load the .ive file and that always works.

I also tried writing a vrml 2.0 file from VMD a popular program used to 
visualize chemistry molecules.  That program wrote out an absolutely huge file 
with one Shape per triangle.  That file can't be loaded.  However, I can write 
a program to read in the vrml file as output by VMD and convert it to a more 
reasonable one that looks like the vrml files output by OpenDX.  I did some 
playing around with that and that will also work.


Joan Slottow



_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to