in
Welcome to Lionhead Community Sign in to Windows Live ID | Help

Last post 10-15-1999, 12:41 by Phili. 2 replies.
Sort Posts: Previous Next
  •  10-15-1999, 12:41 264351

    Howdy, I'm looking for some source code which can load vrml files which I could then render using polygonal models in opengl as part of an application I'm developing. At the same time I'm also looking for source code with would allow me to export polygonal models (made up of verticies) to the vrml file format. If anyone has any suggestions where I could find some I would be very grateful. I forgot to mention I'm developing the application in C/C++. Thanks Phil. http://www.cee.hw.ac.uk/~ceepmg/ [This message has been edited by Phili (edited 15 October 1999).]
  •  10-19-1999, 1:40 264352 in reply to 264351

    Well, I wrote a VRML parser a few years ago but I can't give you the source as it belongs to my old company (I can't use it either if it makes you feel any better) To write this you need to write a parser that understands a certain syntax; Tools such as lex and yacc are for this but I wrote it by hand (probably out of stupidity more than anything else ) First I converted the VRML tokens into an intermediate 'language', a bit like pcode and then I used that to build the scene. The first phase is called (If I can remember my CS course) lexical analysis and splitting it up like this makes the job of building the scene more straight forward. For the first phase, you have to be able to determine what a single token and also to verify data types. Syntax errors are spotted when you have a token or datatype you did not expect and 'scene build-time' errors are things like polygons indexing vertices that aren't there. I'm not really too fond of VRML as a way of describing 3d scenes but I've found that doing things this way means you can reuse the code to parse other languages that are described in this kind of way (i.e. they look a bit like C or pascal) Hope that helps, Tim.
  •  10-19-1999, 10:12 264353 in reply to 264351

    Yeah, I know lex oh what fun....I was hoping someone had already written a loader....looks like I got a lot of work to do.... Cheers Phil http://www.cee.hw.ac.uk/~ceepmg/ "There's a standard then there's Netscape...."
View as RSS news feed in XML