.obj sequence via js

    Jitter

    Robert White's icon
    Robert White's icon
    Robert White
    Nov 02 2020 | 5:00 pm
    Hello, Is it possible to do vboMesh in GL3? Cinder and OpenFramworks both have this. https://libcinder.org/docs/classcinder_1_1gl_1_1_vbo_mesh.html https://openframeworks.cc///documentation/gl/ofVboMesh/
    I've used vbomesh to load .obj sequence files. I'm looking to do the same in GL3. I want to know if it's possible and maybe some tips on where to start?
    thanks, -=Bob

    • Federico-AmazingMaxStuff's icon
      Federico-AmazingMaxStuff's icon
      Federico-AmazingMaxStuff
      Nov 02 2020 | 5:12 pm
      That would be jit.gl.mesh : )
      Share
    • Robert White's icon
      Robert White's icon
      Robert White
      Nov 02 2020 | 6:28 pm
      Thanks Federico, and thanks to your recent class. That's what inspired this question :)
      The only thread I can find is from Rob Ramirez about "Loading multiple .OBJs into Jitter" . I assume he means creating say 30 jit.gl.mesh objects in javascript. And then somehow swapping between them at 30+ fps? That's what I'm looking to do.
      And then.... next step, attaching the obj meshes onto point via jit.gl.TF :)
    • Rob Ramirez's icon
      Rob Ramirez's icon
      Rob Ramirez
      Nov 02 2020 | 7:26 pm
      you can use jit.gl.model to load an obj, and enable matrixoutput on it to bang out the loaded model as a matrix that can be displayed by jit.gl.mesh @drawmode triangles. You could create some patch structure (either JS or vanilla patching) that filled a structure up from a folder of obj files (jit.matrixset might be the easiest structure for this) in some intialization routine. then you can iterate through the matrices in your structure however you wish, drawing the geometry with gl.mesh.
      of course if you can export as a skeleton based animation in a supporting 3d format (e.g. collada .dae) then you can simply load and animate all from jit.gl.model.
    • Federico-AmazingMaxStuff's icon
      Federico-AmazingMaxStuff's icon
      Federico-AmazingMaxStuff
      Nov 02 2020 | 9:06 pm
      This sounds like a cool solution Rob! But isn't matrixset only good for matrices with same size and planecount?
    • Robert White's icon
      Robert White's icon
      Robert White
      Nov 02 2020 | 9:16 pm
      To be clear. The obj files have different vertex counts. Think of a sweep or extrude sequence starting from zero vertices. For collada it just bones and global positioning... I'm pretty sure. Alembic (.abc) would be more along the lines of how to describe it.
    • Robert White's icon
      Robert White's icon
      Robert White
      Nov 20 2022 | 4:51 pm
      Finally attempted a solution here and now I'm trying to get this to render with a jit.gl.pbr via js. Tried Rob's and Federico's suggestions but I couldn't figure out how to build an array of matrix_outputs, each a different dimension. So instead I created an array of jit.gl.models, loaded in .obj files, and this works but I'm not sure if it's the best solution.
      Now I'm trying to take this a step further using pbr but I'm having trouble getting the textures bound to the jit.gl.model(s) in js. Any suggestions how to assign texture to jit.gl.pbr via js? My code is not working. See attached patch, js (line 116),
      07_starBurstObj_OBJ_Seq.zip
      application/zip 1.25 MB
      and zip of .obj files. Thanks,
    • Federico-AmazingMaxStuff's icon
      Federico-AmazingMaxStuff's icon
      Federico-AmazingMaxStuff
      Nov 21 2022 | 9:56 pm
      Hey Robert! We already solved this on Discord but I'm going to post the solution here as well: when assigning the pbr.albedo_texture to null, it broke the JS object. If that part is removed and the texture assignments are called as functions, then it works:
      pbr.albedo_texture(pbr_jit_matrix.name); Also, jitter matrices and gl objects should be freed with the "freepeer()" method before they go out of scope or the patch is closed.
    • Robert White's icon
      Robert White's icon
      Robert White
      Nov 23 2022 | 5:22 pm
      Thank you @Federico! I was having trouble with the js syntax.
      Here is the corrected .js file . First, load an array of .obj files all to create the animated .obj sequence. Second, render with a jit.gl.pbr texture and environment map.
      .obj sequences are a precursor to alembic (.abc) files [https://www.alembic.io/ ] and are good for short animations of 3d models with different vertex counts (i.e. growing plants and vines, polygon effects)