Forums > Jitter

Is it possible to crossfade 3D animation using jit.model dae file?


Jun 12 2013 | 4:34 am

Is it possible to crossfade 3D animation using animated dae file with jit.gl.model, i.e nonlinear animation?

Jun 14 2013 | 11:26 am

Crossfade means what to you in this case?

Meanwhile, look at the help patch for jit.gl.model on the drawing tab.
And any help patch that lets you fade with alpha transparency.

Jun 04 2016 | 7:29 pm

I am interested in this. If I am interpreting this question correctly, Yan wanted to know if one could crossfade the geometry of two animated dae files.

I can do this using jit.gen @gen xfade into jit.gl.mesh, but the only draw mode that works is "polygon." "Triangles" seems to break apart. I am using two models of "Seymore.dae" so I don’t think the dae is the issue, but rather the method I am using in Jitter is incorrect. When drawing with "polygon," Seymore looks distorted and chunky.

Does anyone know how to crossfade the geometry of two animated dae files, in which a model would appear as it should when the crossfade is 0?

Jun 04 2016 | 11:47 pm

well your main issue is seymour has multiple drawgroups, and when your drawgroup attribute is set to 0, the matrixoutput sends out each one individually but very rapidly. and each drawgroup has multiple dimensions, so the input matrix to the gen object is constantly changing. Hook this to the output of one of the models and watch your max console:

— Pasted Max Patch, click to expand. —

So try changing the first model to drawgroup 1 and the second model to drawgroup 4. It’s going to look strange because their dimensions are different. drawgroup 1, the one setting the dimensions of the gen object, has smaller dimensions than drawgroup 4, so when trying to build/xfade into 4, there’s not enough information to build it correctly. However when the first model’s drawgroup dimensions are bigger, the second model doesn’t seem to draw, not sure what’s going on here, but crossfading between two different models (or drawgroups) will produce weird results.

I should mention this is all with gl.mesh using the drawmode: "triangles". It doesn’t draw polygons well, and the models you are using should be triangulated anyways. When using gl.mesh with gl.model, i rarely ever change it from triangles. Other drawmodes will just give weird looking models. However, they might be weird, but they will xfade even with different input dimensions.

It also should be noted that gl.model outputs redundant vertices, so any mesh deformation might seem a bit strange. i’ve been working on something that fixes it, and just updated it (in the last comment): https://cycling74.com/2016/03/01/getting-better-framerates/

Jun 05 2016 | 1:17 am

Thank you for your help with this! Altering the drawgroups gives me a lot more to work with even if the result is odd.

Jun 05 2016 | 4:19 am

Ya multiple drawgroups + animation + xfade is tricky, it mainly has to do with the multiple drawgroups.

If you want to crossfade between the same model, but have the second one be slightly rotated, i think you’ll have to do the rotation in [gen] (which hurts my brain to think about how to do) and use a single gl.model but have it duplicated in gen. Otherwise, using two gl.model’s going into gen is proving to have some issues (i’m guessing output timing issues). I made a little patch example (check out the [gen] object to see how things are patched). Crossfading between the first model and the first model + noise, gives expected results. Crossfading between the first and second model does not. Also you’ll notice i added a [t b l] before the mesh, which solves the multiple drawgroup issue and having them all display at once.

— Pasted Max Patch, click to expand. —

Still racking my brain to solve the issue between xfading between two separate models. I’ll post here if I find anything. I think one sure way is not to have multiple drawgroups.

Jun 05 2016 | 5:49 am

ok i figured out the solution for two models + multi-drawgroups + anim + xfade: [jit.concat]. let me know of any issues.

— Pasted Max Patch, click to expand. —

and here’s something if you want to crossfade between two model texture’s at the same time:

— Pasted Max Patch, click to expand. —

I should also note, that in the drawgroup matrix concat section, it’s not scalable, so if you have models with different numbers of drawgroups, you’ll have to change the [counter] and add/delete [jit.concat]’s accordingly.

Jun 05 2016 | 7:17 am

(that’s weird, my reply post got deleted… here it is again):

ok i figured out the solution for two models + multi-drawgroups + anim + xfade: [jit.concat]. let me know of any issues. plus I added something if you want to crossfade between two model texture’s at the same time (one of the textures is just noise, but can be substituted for anything):

— Pasted Max Patch, click to expand. —

I should also note, that in the drawgroup matrix concat section, it’s not scalable, so if you have models with different numbers of drawgroups (this patch is currently made for 4 groups), you’ll have to change the [counter] and add/delete [jit.concat]’s accordingly.

Jun 05 2016 | 4:50 pm

also as it turns out rotation in gen is pretty simple, and doesn’t hurt my brain like i had assumed, thanks to the awesome [qrot]. I’m not quite sure if xfading between 2 of the same model, with the second instance being slightly rotated, was your true intent or if it was just something quickly put together to make an example patch, but Rob put together a pretty concise example of how to position/rotate/scale all in [gen]:

https://cycling74.com/forums/topic/jit-gl-node-like-nested-3d-transformations-on-matrix-cpu-side/

Jun 06 2016 | 8:43 am

jit.gl.model also has the ability to crossfade between different animations in a model file, for model files that support multiple animations. this is controlled via the "animweight" message and "animblendmode" attribute.

Jun 06 2016 | 10:16 am

Hey Rob, is ninja.mesh.xml the only model in the Max library with multiple indexed animations? I’d love to try it out, but everytime i enable one of the animations, the model disappears. I found some other model types of that ninja (b3d and ms3d) at the psionic website, but neither seem to have indexed animations.

Viewing 11 posts - 1 through 11 (of 11 total)

Forums > Jitter