About vertex morphing...

You are an experienced programmer and have a problem with the engine, shaders, or advanced effects? Here you'll get answers.
No questions about C++ programming or topics which are answered in the tutorials!
Post Reply
Domin

About vertex morphing...

Post by Domin »

I'm after a lecture of CAnimatedMeshMD2.cpp. It seems like there is no "real" interpolation beetwen positions of vertices - instaed of that we have fixed eight (Lsh by 3) positions of each vertex beetwen frames... I'm wondering why this is done in that way? If you, Niko have some time to explain this it will be great. I think that interpolation should be based mostly on time passed until last render. Knowing that, time needed to transform and distance beetwen vertices we may calculate interpolated position of each vertex. I'm afraid that current solution have some disadventages - first - when we want really slow morphing we need more that eight positions - try to slow down morphing to see the efect. Second - what about needed memory? It looks like we have similiar situation with ms3d - but here everything is multipled by 40 (BTW - why 40???)...
niko
Site Admin
Posts: 1759
Joined: Fri Aug 22, 2003 4:44 am
Location: Vienna, Austria
Contact:

Post by niko »

There is no special reason for this. 40 is just a value I though would be ok. My big problem was simply, that the frame number overgiven to the animation player is an integer. So I had to scale the frame amount by a certain value. But it would be better to change the fps amount into a float value.
Domin

Post by Domin »

Thanks, now I see this - float fps may be some kind of solution - main goal here is to trow out the confusing frame multiplers (8 in md2 and 40 in ms3d) and stay with original frame count. But if I assumed correctly, we still stay with fixed nb of morph positions beetwen frames? Do you plan to change this in the next release? I'm afraid this may cause deep changes in engine structure...
niko
Site Admin
Posts: 1759
Joined: Fri Aug 22, 2003 4:44 am
Location: Vienna, Austria
Contact:

Post by niko »

Domin wrote:But if I assumed correctly, we still stay with fixed nb of morph positions beetwen frames? Do you plan to change this in the next release? I'm afraid this may cause deep changes in engine structure...
If we have float frame numbers instead, why should we stay with that? Why do you mean it would cause deep changes in the engine structure?
Domin

Post by Domin »

Mea culpa - I thought that you want to change to float the FramesPerSecond member of CAnimatedMeshSceneNode, like you wrote in previous post, not frame number. In this case it should be ok (if you say so :)
Post Reply