[GRASS5] [bug #2152] (grass) VRML 1.0 export

Glynn Clements glynn.clements at virgin.net
Sun Oct 12 14:41:52 EDT 2003


Paul Kelly wrote:

> > The VRML 1.0 export is not working well. The mesh producted is not standard VRML. It
> > adds a ' , ' after the last Coordinate3 point description. Same for the last
> > IndexedFaceSet : should be "a,b,c,-1"  and not "a,b,c,-1,"
> 
> The attached patch to p.vrml would fix this (presumably the Material Color
> section should have the same treatment). But I haven't had any problems
> with the current output. Are there some readers the VRML output won't work
> with? Can you give a link to somewhere describing the VRML standard that
> shows it as you describe? Then we could apply the change to p.vrmlIndex: put_grid.c

The VRML 1.0 standard explicitly permits a trailing comma:

http://www.web3d.org/technicalinfo/specifications/VRML1.0/index.html#Fields

	Multiple-valued fields are written as a series of values
	separated by commas, all enclosed in square brackets. If the
	field has zero values then only the square brackets ("[]") are
	written. THE LAST MAY OPTIONALLY BE FOLLOWED BY A COMMA. If
	the field has exactly one value, the brackets may be omitted
	and just the value written. For example, all of the following
	are valid for a multiple-valued field containing the single
	integer value 1:

[Emphasis mine.]

So, it's a bug in the viewer.

FWIW, VRML 97 is even more liberal; the comma is considered a
whitespace character.

-- 
Glynn Clements <glynn.clements at virgin.net>




More information about the grass-dev mailing list