go to
http://www.sourceforge.net/projects/rentools/ and download w3dview.
It is a w3d viewer I wrote that can view renegade and some SAGE w3d files.
It cant handle the newest SAGE w3d files (i.e. BFME2 with shaders and stuff).
Also, it doesnt actually parse and display all things a w3d file can do but it does most of it (textures, geometry, animation etc).
It does contain the data structures for the chunks that it doesnt actually parse (like particle emitters for example)
Most importantly, the whole source code for it is released under the GNU General Public Licence.
It is written in pure C and OpenGL as it was done for a University course as a project and those were the requirements
As far as I am aware, this is probobly the best resource for w3d files and their format that exists.