Menu ▾ ▴

#2 parser ignores diffuseColor

open
nobody
None
5
2014-08-15
2004-11-05
Anonymous
No

Hi there!

I downloaded CyberVRML97 and parsed a VRML file with
a section like

appearance Appearance {
material Material {
diffuseColor 0.84, 0.82, 0.68
...

The problem of your parser is, that it doesn't
like "diffuseColor" stuff, thus it aborts parsing.
I debugged the source code, in VRML.tab.cpp (same in
VRML97.tab.cpp for CyberX3D) it calls AddSFFloat(yyvsp
[0].fval) - which looks like it expects only 1 float,
instead of 3.
All in all, there is no possibility to parse diffuseColor
(even there is setDiffuseColor(float r, float g, float b) in
MaterialNode.h prepared, problem is in parser, not the
scenegraph).

If I knew how the parser work (all the mess with
numerical rules is very opaque, some help would be
appreciated), I'd fix it.

Discussion