Forums WoW Modding Support Archives WoWModding Support Archives [DiscordArchive] Lacks interpolation ?

[DiscordArchive] Lacks interpolation ?

[DiscordArchive] Lacks interpolation ?

Pages (4): 1 2 3 4 Next
rektbyfaith
Administrator
0
06-12-2025, 01:01 PM
#1
Archived author: Titi • Posted: 2025-06-12T13:01:32.211000+00:00
Original source

Lacks interpolation ?
rektbyfaith
06-12-2025, 01:01 PM #1

Archived author: Titi • Posted: 2025-06-12T13:01:32.211000+00:00
Original source

Lacks interpolation ?

rektbyfaith
Administrator
0
06-12-2025, 03:33 PM
#2
Archived author: Saty • Posted: 2025-06-12T15:33:05.192000+00:00
Original source

Very much yes xD But for 9 days of work it's pretty good already I would say.
I mean this is the worst it will be, only gonna improve from here <:kekw:1301383133899522078>
rektbyfaith
06-12-2025, 03:33 PM #2

Archived author: Saty • Posted: 2025-06-12T15:33:05.192000+00:00
Original source

Very much yes xD But for 9 days of work it's pretty good already I would say.
I mean this is the worst it will be, only gonna improve from here <:kekw:1301383133899522078>

rektbyfaith
Administrator
0
06-12-2025, 03:33 PM
#3
Archived author: Saty • Posted: 2025-06-12T15:33:46.939000+00:00
Original source

Nope. Probably did it wrong tho somehow. Need to check again
rektbyfaith
06-12-2025, 03:33 PM #3

Archived author: Saty • Posted: 2025-06-12T15:33:46.939000+00:00
Original source

Nope. Probably did it wrong tho somehow. Need to check again

rektbyfaith
Administrator
0
06-12-2025, 05:59 PM
#4
Archived author: Saty • Posted: 2025-06-12T17:59:02.132000+00:00
Original source

```cs
if (modelBone.Rotation.Timestamps.Count > 0)
{
var rotationtimestamps = modelBone.Rotation.Timestamps[CurrentSequence];
for (int j = 1; j < rotationtimestamps.Count; j++)
{
if (currentMilliseconds >= rotationtimestamps[j - 1] && currentMilliseconds < rotationtimestamps[j])
{
var startRaw = modelBone.Rotation.Values[CurrentSequence][j - 1];
Quaternion start = new Quaternion(startRaw.Y, startRaw.Z, -startRaw.X, -startRaw.W);
var endRaw = modelBone.Rotation.Values[CurrentSequence][j];
Quaternion end = new Quaternion(endRaw.Y, endRaw.Z, -endRaw.X, -endRaw.W);
var t = (currentMilliseconds - rotationtimestamps[j - 1]) / (float)(rotationtimestamps[j] - rotationtimestamps[j - 1]);

switch (modelBone.Translation.InterpolationType)
{
case M2Track<M2Lib.types.C3Vector>.InterpolationTypes.Instant:
{
desiredRotation = start;
}
break;
case M2Track<M2Lib.types.C3Vector>.InterpolationTypes.Linear:
{
desiredRotation = math.nlerp(start, end, t);
}
break;
case M2Track<M2Lib.types.C3Vector>.InterpolationTypes.Bezier:
{
// TODO implement bezier!!!
desiredRotation = math.nlerp(start, end, t);
}
break;
case M2Track<M2Lib.types.C3Vector>.InterpolationTypes.Hermite:
{
// TODO implement hermite!!!!
desiredRotation = math.nlerp(start, end, t);
}
break;
}
}
}
}
```

Anyone with a few more braincells than me maybe sees why the rotation might be so jittery? (Bezier and Hermite not used in the login model)
rektbyfaith
06-12-2025, 05:59 PM #4

Archived author: Saty • Posted: 2025-06-12T17:59:02.132000+00:00
Original source

```cs
if (modelBone.Rotation.Timestamps.Count > 0)
{
var rotationtimestamps = modelBone.Rotation.Timestamps[CurrentSequence];
for (int j = 1; j < rotationtimestamps.Count; j++)
{
if (currentMilliseconds >= rotationtimestamps[j - 1] && currentMilliseconds < rotationtimestamps[j])
{
var startRaw = modelBone.Rotation.Values[CurrentSequence][j - 1];
Quaternion start = new Quaternion(startRaw.Y, startRaw.Z, -startRaw.X, -startRaw.W);
var endRaw = modelBone.Rotation.Values[CurrentSequence][j];
Quaternion end = new Quaternion(endRaw.Y, endRaw.Z, -endRaw.X, -endRaw.W);
var t = (currentMilliseconds - rotationtimestamps[j - 1]) / (float)(rotationtimestamps[j] - rotationtimestamps[j - 1]);

switch (modelBone.Translation.InterpolationType)
{
case M2Track<M2Lib.types.C3Vector>.InterpolationTypes.Instant:
{
desiredRotation = start;
}
break;
case M2Track<M2Lib.types.C3Vector>.InterpolationTypes.Linear:
{
desiredRotation = math.nlerp(start, end, t);
}
break;
case M2Track<M2Lib.types.C3Vector>.InterpolationTypes.Bezier:
{
// TODO implement bezier!!!
desiredRotation = math.nlerp(start, end, t);
}
break;
case M2Track<M2Lib.types.C3Vector>.InterpolationTypes.Hermite:
{
// TODO implement hermite!!!!
desiredRotation = math.nlerp(start, end, t);
}
break;
}
}
}
}
```

Anyone with a few more braincells than me maybe sees why the rotation might be so jittery? (Bezier and Hermite not used in the login model)

rektbyfaith
Administrator
0
06-12-2025, 06:01 PM
#5
Archived author: Saty • Posted: 2025-06-12T18:01:09.137000+00:00
Original source

Position is buttery smooth, tested everything without positioning and it still jitters.
I have a feeling this might be:
a) A unity bug
b) Something not taken into account from the parent

Like with positions the coordinates from objects with a parent are relative, while objects without parent are absolute...
Maybe same case here? Am to stupid for quaternion math tho
rektbyfaith
06-12-2025, 06:01 PM #5

Archived author: Saty • Posted: 2025-06-12T18:01:09.137000+00:00
Original source

Position is buttery smooth, tested everything without positioning and it still jitters.
I have a feeling this might be:
a) A unity bug
b) Something not taken into account from the parent

Like with positions the coordinates from objects with a parent are relative, while objects without parent are absolute...
Maybe same case here? Am to stupid for quaternion math tho

rektbyfaith
Administrator
0
06-12-2025, 06:01 PM
#6
Archived author: Titi • Posted: 2025-06-12T18:01:18.880000+00:00
Original source

first change the => to a >, you don't want two different times to have the same value
`if (currentMilliseconds >= rotationtimestamps[j - 1]`
rektbyfaith
06-12-2025, 06:01 PM #6

Archived author: Titi • Posted: 2025-06-12T18:01:18.880000+00:00
Original source

first change the => to a >, you don't want two different times to have the same value
`if (currentMilliseconds >= rotationtimestamps[j - 1]`

rektbyfaith
Administrator
0
06-12-2025, 06:02 PM
#7
Archived author: Saty • Posted: 2025-06-12T18:02:03.002000+00:00
Original source

You sure? That skips frame 1 tho
rektbyfaith
06-12-2025, 06:02 PM #7

Archived author: Saty • Posted: 2025-06-12T18:02:03.002000+00:00
Original source

You sure? That skips frame 1 tho

rektbyfaith
Administrator
0
06-12-2025, 06:02 PM
#8
Archived author: Titi • Posted: 2025-06-12T18:02:09.228000+00:00
Original source

it could mess up with the other check just being a <
rektbyfaith
06-12-2025, 06:02 PM #8

Archived author: Titi • Posted: 2025-06-12T18:02:09.228000+00:00
Original source

it could mess up with the other check just being a <

rektbyfaith
Administrator
0
06-12-2025, 06:02 PM
#9
Archived author: Titi • Posted: 2025-06-12T18:02:40.348000+00:00
Original source

ah yeah, maybe hackfix for frame 0
rektbyfaith
06-12-2025, 06:02 PM #9

Archived author: Titi • Posted: 2025-06-12T18:02:40.348000+00:00
Original source

ah yeah, maybe hackfix for frame 0

rektbyfaith
Administrator
0
06-12-2025, 06:04 PM
#10
Archived author: Saty • Posted: 2025-06-12T18:04:01.897000+00:00
Original source

nlerp btw being:
```cs
public static quaternion nlerp(quaternion q1, quaternion q2, float t)
{
return normalize(q1.value + t * (chgsign(q2.value, dot(q1, q2)) - q1.value));
}
```
rektbyfaith
06-12-2025, 06:04 PM #10

Archived author: Saty • Posted: 2025-06-12T18:04:01.897000+00:00
Original source

nlerp btw being:
```cs
public static quaternion nlerp(quaternion q1, quaternion q2, float t)
{
return normalize(q1.value + t * (chgsign(q2.value, dot(q1, q2)) - q1.value));
}
```

Pages (4): 1 2 3 4 Next
Recently Browsing
 1 Guest(s)
Recently Browsing
 1 Guest(s)