.obj sequence via js
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?
- Federico-AmazingMaxStuffNov 02 2020 | 5:12 pmThat would be jit.gl.mesh : )
- Rob RamirezNov 02 2020 | 7:26 pmyou 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-AmazingMaxStuffNov 02 2020 | 9:06 pmThis sounds like a cool solution Rob! But isn't matrixset only good for matrices with same size and planecount?
- Robert WhiteNov 02 2020 | 9:16 pmTo 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 WhiteNov 20 2022 | 4:51 pmFinally 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),and zip of .obj files. Thanks,
- Federico-AmazingMaxStuffNov 21 2022 | 9:56 pmHey 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 WhiteNov 23 2022 | 5:22 pmThank 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)