Q3D V-2.4 [3D Physics + Skeletal Animation UPDATE]

Post your completed addons to share with the community

Post » Wed Feb 11, 2015 5:45 am

kmsravindra wrote:Understood. I will give this early loading a try. Also I hope you were able to reproduce the error I mentioned above...Thanks!


It's late so i'll give it a try another day, thanks for the walk-through though!
B
75
S
13
G
8
Posts: 1,973
Reputation: 9,841

Post » Wed Feb 11, 2015 11:26 am

@QuaziGNRLnose, few updates from my side -

1. I have followed what you said about initialization ( "created model, loaded .js file, destroy on model created" sequence for each .js file) and it worked pretty well without any lags! Though it looked funny just to create and destroy Q3Dobjects in the C2 code, I think it made sense from a threejs perspective...However, a neater way could be to have such stuff abstracted from the user, if possible...Anyway, thanks a lot for that tip.

2. I also happened to figure out that one of my .js model file was quite big ( something like 5 MB) that was causing the FPS drop...When I optimized this .js model file, I was able to get it working on iPad!

The js error with switching layouts still remains if I dont take care of that in the C2 code...
B
84
S
20
G
3
Posts: 337
Reputation: 7,368

Post » Wed Feb 11, 2015 5:52 pm

@kmsravindra

Yea its a bit wonky but its also how you initialize other objects in C2 (even the official plugins).

When i have the time ill fix that interlayout bug. But as i suggested try making q3d master global and having only one instance instead of having multiple. This will make your application faster, because each Q3D master carries out an expensive initialization step on create/destroy
B
75
S
13
G
8
Posts: 1,973
Reputation: 9,841


Post » Fri Feb 13, 2015 9:58 am

@QuaziGNRLnose, When I am use morph animation "DO loop and do ping pong" mode - then I see that the animation once it reaches the last frame momentarily jumps back to first frame ( seen like a flicker) before it starts going back from last frame to first frame. The same DOES NOT happen when I use "DON'T loop and do ping pong". If you want to verify this, you can verify it in the .capx file that I shared with you.
Last edited by kmsravindra on Fri Feb 13, 2015 10:23 am, edited 1 time in total.
B
84
S
20
G
3
Posts: 337
Reputation: 7,368

Post » Fri Feb 13, 2015 10:20 am

where is manual how to use this plugin? i would like to read it before getting it, thank you
B
11
S
3
G
1
Posts: 418
Reputation: 1,780

Post » Fri Feb 13, 2015 5:48 pm

kmsravindra wrote:@QuaziGNRLnose, When I am use morph animation "DO loop and do ping pong" mode - then I see that the animation once it reaches the last frame momentarily jumps back to first frame ( seen like a flicker) before it starts going back from last frame to first frame. The same DOES NOT happen when I use "DON'T loop and do ping pong". If you want to verify this, you can verify it in the .capx file that I shared with you.


strange, i noticed that. I'll fix it. It's due to me only testing with animations that loop cyclically so i didn't notice the issue

if you want to fix it before the next update it'll be really quick.

look for the block of code around line 163 in the Q3D Morph Controller Behaviour runtime.js file that looks like this

Code: Select all
            if (a.pingpong){
            
               a.t = a.t+a.speed*(dt)
               if(a.t > Ma.animlen){
               a.t = Ma.animlen
               a.speed = a.speed*-1
               a.pong = -1;
               }else if( a.t < 0){
               a.t = 0
               a.speed = a.speed*-1
               };
            
            }


and change it to this:

Code: Select all
            if (a.pingpong){
            
               a.t = a.t+a.speed*(dt)
               if(a.t > Ma.animlen-1){
               a.t = Ma.animlen-1
               a.speed = a.speed*-1
               a.pong = -1;
               }else if( a.t < 0){
               a.t = 0
               a.speed = a.speed*-1
               };
            
            }


i had forgotten the "-1" after Ma.animlen

also a suggestion: you could store the multiple animations for the cube in a single file, and use different animation names.

EDIT:

I also think i know why your ipad performance is extra low. Your exported models have skinning/bones information, which they never use. When you export morph targets, you don't need to check skinning/bones/skeletal animation in blender, or else you'll get both morph targets AND bones. Bones are loaded even though they aren't properly used, and they also waste a lot of memory if you're not using them. You don't need to check that stuff if you made your animation using bones, you only need it if you want to actually use the bones with the model in real time, which isn't supported yet in Q3D anyway (it will eventually).

I managed to fix both the bugs you reported so they'll be gone in the next update
Last edited by QuaziGNRLnose on Fri Feb 13, 2015 6:25 pm, edited 11 times in total.
B
75
S
13
G
8
Posts: 1,973
Reputation: 9,841

Post » Fri Feb 13, 2015 5:49 pm

ex32 wrote:where is manual how to use this plugin? i would like to read it before getting it, thank you


I don't have one made yet, as the plugin is still undergoing lots of changes. a manual will likely be out in a few months after physics and skinned animation using bones are implemented.
B
75
S
13
G
8
Posts: 1,973
Reputation: 9,841

Post » Sat Feb 14, 2015 2:14 am

@QuaziGNRLnose, thanks a lot. I will change the code as you mentioned in the behavior runtime.js as I am overdue to submit the app to app store. Also thanks for the tips on performance. If any of this performance improvements help it to run smoother on iPad, I want to put "lights on" in my app for that extra effect. :)
B
84
S
20
G
3
Posts: 337
Reputation: 7,368

Post » Sat Feb 14, 2015 3:25 am

I see many people are using this plugin without problem. How about mobile performance with lights? anyone tested it?
B
11
S
3
G
1
Posts: 418
Reputation: 1,780

PreviousNext

Return to Completed Addons

Who is online

Users browsing this forum: davidbox, Yahoo [Bot] and 4 guests