Closed for Company Meetings: Between September 18 (5pm PDT) and September 22 (12pm PDT), Support and Sales requests will be delayed. Only time-sensitive issues will be addressed during that time. Thanks for your patience.
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?
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:
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.
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.
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.
ok i figured out the solution for two models + multi-drawgroups + anim + xfade: [jit.concat]. let me know of any issues.
and here's something if you want to crossfade between two model texture's at the same time:
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.
(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):
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.
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]:
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.
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.