Three js and Web gl loader

46 views
Skip to first unread message

hscham...@gmail.com

unread,
Sep 13, 2013, 7:52:12 PM9/13/13
to webgl-load...@googlegroups.com
Hello there,

First off I want to thank you for implementing this great compression scheme and putting it out there it for use. I'm especially impressed with your buddha example.
I am having trouble implementing the UTF8oader with three js with webgl-loader.

I have a working version with the hand example and the compressed utf8 file that is packaged with three js, however when I compress  hand_00.obj file from http://www.sci.utah.edu/~wald/animrep/ using webgl-loader  rev 107 the json output is different from the hand.js example shipped with three js

I am using the same rev (60) of three js as in his example located here : http://threejs.org/examples/webgl_loader_utf8.html The file below errored when i ran objcompress but you can still see the format difference. I checked rev 50 of webgl-loader as per the notification on the homepage but it's foramatting is very different. Also on the three.js utf8 test page it specifies version 100 of webgl-loader

here is the hand.js example that works with three js
{
  "materials": {
    "preview": { "Kd": [184, 136, 234] },
    "nails": { "Kd": [251, 238, 209], "map_Kd": "hand.jpg", "Ks": [30,30,30], "Ns": 100 },
    "skin": { "Kd": [207, 181, 161],  "map_Kd": "hand.jpg", "Ks": [30,30,30], "Ns": 30 }
  },
  "decodeParams": {
    "decodeOffsets": [-7473,-239,-8362,0,0,-511,-511,-511],
    "decodeScales": [0.000050,0.000050,0.000050,0.000978,0.000978,0.001957,0.001957,0.001957]
  },
  "urls": {
    "hand.utf8": [
      { "material": "nails",
        "attribRange": [0, 261],
        "codeRange": [2088, 817, 404]
      },
      { "material": "preview",
        "attribRange": [2905, 688],
        "codeRange": [8409, 2570, 1280]
      },
      { "material": "skin",
        "attribRange": [10979, 8899],
        "codeRange": [82171, 31026, 15451]
      }
    ]
  }
}

when i run webgl-loader obj compress on hand_00.obj i end up with :
 
 /Users/hschamberlin/webgl_loader_test/trunk/bin/objcompress hand_00.obj test.utf8
WARNING: s ignored at line 2851
MODELS['hand_00.obj'] = {
  materials: {
    "preview": { "Kd": [184, 136, 234] }    "nails": { "map_Kd": "hand.ppm" }    "skin": { "map_Kd": "hand.ppm" }  },
  decodeParams: {
    "decodeOffsets": [-7473,-239,-8362,0,0,-511,-511,-511],
    "decodeScales": [0.000050,0.000050,0.000050,0.000978,0.000978,0.001957,0.001957,0.001957]
  }  urls: {
    'cd49b6b7.test.utf8': [
      { material: 'nails',
        attribRange: [0, 261],
        indexRange: [2088, 404],
        bboxes: 3300,
        names: ['figure_2', 'figure_2', 'figure_2', 'figure_2', 'figure_2', ],
        lengths: [240, 240, 240, 240, 252, ],
      },
    ],
    '6ff14479.test.utf8': [
      { material: 'preview',
        attribRange: [0, 688],
        indexRange: [5504, 1280],
        bboxes: 9344,
ERROR: no suitable group found at line 37322

Thanks for taking a look at this and thank you again for dedicating your time to webgl funtionality.

Skylr







Won

unread,
Oct 31, 2013, 5:35:57 PM10/31/13
to webgl-load...@googlegroups.com
Hey Skylr,

Sorry for the super-long delay. Unfortunately, I don't know much about the three.js port since I didn't do it (I think it was Altered Qualia, who isn't working that much on three.js anymore?). But I think the two versions did diverge. There are/were 3 implementations of the algorithm in webgl-loader, objcompress, obj2utf8 and obj2utf8x (or something) and I don't know which one Three.js wants. Try obj2utf8?

-Won

PS Thanks for using my stuff, I wish I could spend more time maintaining it. :(


--
You received this message because you are subscribed to the Google Groups "webgl-loader-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to webgl-loader-dis...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

skylr chamberlin

unread,
Oct 31, 2013, 5:44:07 PM10/31/13
to webgl-load...@googlegroups.com
Hi Won,

No worries, 

I ended up just gzipping everything and have been leaving it at that, though it's always nice to load stuff in a more efficient manner. Keeping up with three js and it's lack of documentation is a pain, I have seen some recent work on the utf8 loader, but am staying away from it for now. I will invest some more time into speeding up the loading process when it's more applicable. Maybe i will check in with you then.

No worries on the maintainence, I totally understand thanks for sharing =) 

What are you working on these days ? Anything related to web-gl or 3d rendering ?


Skylr


--
You received this message because you are subscribed to a topic in the Google Groups "webgl-loader-discuss" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/webgl-loader-discuss/e6yLrKcubCo/unsubscribe.
To unsubscribe from this group and all its topics, send an email to webgl-loader-dis...@googlegroups.com.

Won

unread,
Oct 31, 2013, 5:45:37 PM10/31/13
to webgl-load...@googlegroups.com
Well, I'll give you a hint:

I have a deadline for this event http://www.steamdevdays.com

-Won

skylr chamberlin

unread,
Oct 31, 2013, 6:08:55 PM10/31/13
to webgl-load...@googlegroups.com
Nice good luck with that, looks like an interesting conference.

Skylr
Reply all
Reply to author
Forward
0 new messages