Building webgl-loader

37 views
Skip to first unread message

Paul Norman

unread,
Apr 20, 2012, 9:51:26 AM4/20/12
to webgl-loader-discuss
Hi,

This is definitely a newbie question!

Can you advise how best to build the code so that I can correctly
convert obj files to utf8 and js formats. I'm running windows 7 and
visual studio 2008.
I've tried to build in that format but it can't find the strtof
function in the stdlib (a gcc versus c99 thing?) and the build script
using Cygwin but not getting anywhere quickly.

Any help is much appreciated.

Thanks,
Paul

Won

unread,
Apr 20, 2012, 11:32:07 AM4/20/12
to webgl-load...@googlegroups.com
Hi Paul,

First of all, thanks for looking into this library! Would you mind letting me know what you plan on using it for? I'm trying to do my best as one-man-band on this project, and part of that includes product management.

To you issues: Mmy apologies! These are definitely not newbie questions. In the short term, could you try just changing strtof to strtod (with the appropriate cast) for now?

You might want to star Issue #30:


which is tracking some cross-build issues, and also contains a few tips on getting things working. I do need to update it, since some of those issues are already addressed.

There are a few issues that have to do with building on Windows, and strtof is definitely one of them. For some reason, Windows compilers tend not to like C99 stuff like strtof or %zu, and since I generally don't build in MSVC these sorts of things slip through. I do have access to a Windows machine, and I'm in the middle of getting MinGW  and the free MSVC (I believe 2010?) up and running so I can validate things. My goal is to be warning free on GCC, MSVC, and clang.

I doubly apologize for my build scripts, which are just my being lazy. It might be time to invest in a cross-platform build system, soon.

-Won

Paul Norman

unread,
May 21, 2012, 6:35:56 AM5/21/12
to webgl-loader-discuss
Hi,

I've been away on other things recently but have just got back to
looking at using the webgl-loader in combination with the open-3d-
viewer.

As I mentioned on another thread I started by mistake in this
discussion group I'd like to be able to create/edit models and save
them in obj format so that I can convert them into utf8 files for
loading into the viewer. I'm currently using Blender to do this. I've
converted the original Bessie.obj file and can load and view that but
if I try to edit it in anyway I no longer see it (I also gets some
warnings during the conversion process regarding the 's' command).

I suspect this may have something to do with the
cow_anatomy_metedata.json file required by the viewer. Can this file
be created during the conversion process and if so how, and if not how
would I go about creating it?

Any help would be much appreciated.

Paul

Won

unread,
May 21, 2012, 3:26:56 PM5/21/12
to webgl-load...@googlegroups.com
Could you send me the post-Blender'd OBJ and MTL file?

-Won

Paul Norman

unread,
May 22, 2012, 4:49:42 AM5/22/12
to webgl-load...@googlegroups.com
Sorry, finger trouble there!

As I was saying the export settings were

- Apply Modifiers
- Include Edges
= Include Normals
- Include UVs
- Write Materials
- Objects as OBJ Groups
- Material Groups
- Keep Vertex Order

I've also include the json file and the two text files that seem to specify the structure ofthe model. I'm not sure how these are constructed by the json file seems to be key.

Thanks for your help.

Paul
Reply all
Reply to author
Forward
0 new messages