|
Note: Instead of adding some gay anti-leech to prevent over usage of this I am minimizing the amount of code I am providing.
This is actually linear interpolation of positions instead of interpolating transformation values. If you want to do the latter then it involves finding the appropriate transformation of this skin and type in the next frame, subtracting the parameters and then progressing them as necessary. This has also been called tweening.
Open Model.java
Create copies of method470, method471, method472. Name them "applyTransformFuture", "mixTransformFuture" and "transformStepFuture".
Create copies of anIntArray1627, anIntArray1628, anIntArray1629. Name them "vertexXFuture", "vertexYFuture", "vertexZFuture".
Go into transformStepFuture and replace all occurrences of the original arrays with the new ones. Go into applyTransformFuture & mixTransformFuture and replace all usages of the original methods with the new ones.
Find all times the original arrays are redefined or written to, and mimic (copy) the information to the new arrays.
Find all usages of method470 and method471, and add a call below it to applyTransformFuture and mixTransformFuture but for the next frame in the sequence.
Define this method in Model:
After applyTransformFuture and mixTransformFuture usage, call interpolate. The parameter should be a value between 0d and 1d. This can be calculated by (([the current amount of render frames this animation frame has been shown for] * 1d) / [animation frame length]Code:public void interpolate(double progression) { for (int v = 0; v < vertexXFuture.length; v++) { double diffX = vertexXFuture[v] - anIntArray1627[v]; double diffY = vertexYFuture[v] - anIntArray1628[v]; double diffZ = vertexZFuture[v] - anIntArray1629[v]; anIntArray1627[v] += (int) (diffX * progression); anIntArray1628[v] += (int) (diffY * progression); anIntArray1629[v] += (int) (diffZ * progression); } }
If you're too lazy to copy all of the actions, make a method in Model which reconstructs vertex[X/Y/Z]Future to be the same size as the other arrays and then copy all the values. Then you call this before the FIRST animation frame (method470/method471) is applied.
Nasty release thanks a ton!
Care to explain how to know which frames mesh with which frame..
For instance
EDIT:Code:Class36 class36 = Class36.method531(Animation.anims[anim2].anIntArray353[animationFramePosition]); Class36 class36next = Class36.method531(Animation.anims[anim2].anIntArray353[animationFramePosition + 1]); for(int j = 0; j < class36next.anInt638; j++) { for(int j2 = 0; j2 < class36.anInt638; j2++) { int a = class36next.anIntArray639[j]; int a2 = class36.anIntArray639[j2]; if (a == a2) { //these frames will be tweened break; } } }
My problem is complex animations will not mesh correctly, but simple animations like walking will mesh correctly.
I don't think you understand, this is the animation being applied to the model
Now see how k = the index of the animation frame being applied to the model, now the question is how do you find the index in the next animation frame that you would be meshed with the current animation frame. As in..Code:for(int k = 0; k < class36.anInt638; k++) { int l = class36.anIntArray639[k]; method472(class18.anIntArray342[l], class18.anIntArrayArray343[l], class36.anIntArray640[k], class36.anIntArray641[k], class36.anIntArray642[k]); }
Code:for(int j = 0; j < class36next.anInt638; j++) { for(int j2 = 0; j2 < class36.anInt638; j2++) { if (this next frame should be tweened with the frame at index j, this is the part i need) { model_2.method472( class18.anIntArray342[a2], class18.anIntArrayArray343[a2], blah); break; } } }
Animation frames are standalone, not progressive. Look at the class which loads seq.dat. This is the class which you can get the next frame from.
The only thing that I am unsure about is: the current amount of render frames this animation frame has been shown for
Never heard of it
« Previous Thread | Next Thread » |
Thread Information |
Users Browsing this ThreadThere are currently 1 users browsing this thread. (0 members and 1 guests) |