|
From: Damian M. <da...@er...> - 2001-12-02 06:51:31
|
With 'GTKLOOKAT', I am reading a ( boring but small sample ) file a.wrl which 'inlines' a URL file model/c.wrl which in turn reads a URL (image) files image/asp.jpg The file a.wrl resides in the current directory, as does the directory 'model'. Directory 'image' resides within 'model'. In the first pass through the VRML nodes, done with readWwl ( which is associated with a Doc ), the part of each included file, i.e. the d_relativeUrl, is correct. It uses VrmlNodeInline::addToScene which (calls) VrmlNodeInline::load which (calls) VrmlScene::readWrl However, on a second pass through, the 2nd level nested file, sky.jpg, thinks its parent is a.wrl, not model/c.wrl. As a result, the nested image cannot be found. I do not know where these nodes are being processed. It is definitely not readWrl. If I ensure that the directory image is in the same directory as 'a.wrl', this solves the problem but that isn't the point. I don't have control like this all the time. VRML is supposed to take care of nesting. I can't even figure out which routine is used to make the second pass but it isn't the same as the first pass. There seem like there are many routines that do fundamentally the same thing and I am lost. The offending (underlying) variable is d_relativeUrl. This is a field of VrmlNodeTexture ....AudioClip ....Background To track this down, I need some help on understanding the structure of these heavily nested classes. 1) How, from a VrmlNodeTexture node, get the d_url that belongs to its associated VrmlNodeImageTexture ( I have one image associated with each texture ). Note that d_url belongs in VrmlNodeImageTexture ........MovieTexture ........AudioClip ........Anchor ........Inline 2) Where would the actual URL ( filename in my case ) of url "filename.jpg" be actually copied into ( what appears to be the VrmlMFString ) d_url in VrmlNodeImageTexture which is later extracted as an array of URLs with the method d_url.get() or (char *) d_url.getElement(0) This might help me to isolate where the corruption is occuring. 3) Any other suggestions are welcomed. Don't tell me to use 'GDB' because to use that effectively assumes you know something about the structure and where to jump to. I'm hoping that somebody out there already knows the structure. My UNIX data files are included. I am not a VRML expert. I just want to view files created by anther programs. Before this exercise, I thought I knew something about object-oriented programming and C++ and reusability. I am starting to doubt that now. As an aside, and while I marvel at this body of work, has anybody ever pulled apart 'vrm97node.cpp' to work with each class. 10,000 lines is a nightmare. Thanks - Damian (McGuckin) Pacific Engineering Systems International, 22/8 Campbell St, Artarmon NSW 2064 Ph:+61-2-99063377 .. Fx:+61-2-99063468 | unsolicited email not wanted here ! Views and opinions here are mine and not those of any past or present employer |