Hello guys,
I’ve done the on-click animations of drawers and doors for my shapediver model on my front end but I’m facing an issue, when I click then sometimes the door after animation goes back to its original position, and sometimes not. It’s not fixed, sometimes it happens more for door1 let’s say not for door2 but sometimes it happens for both door1,2 It also changes as per the sequence of the clicking. And sometimes it works smoothly, doesn’t happens at all. Similarly for the drawers.
For DOORS-
These are original positions
Below are the pictures when I clicked doors in this sequence- door1, door2, door3, door 4
On clicking 1,2
then on clicking 3,4
On relaoding and after changing the sequence of clicking it kinda looked same this time
For DRAWERS-
The original positions
When I clicked drawer in the sequence- drawer1, drawer2, drawer3
On reloading when I clicked drawers like - drawer2, drawer3, drawer1
My animation code-
For doors-
const times = [0, 1, 2, 3];
const values = [
quat0[0], quat0[1], quat0[2], quat0[3],
quat1[0], quat1[1], quat1[2], quat1[3],
quat1[0], quat1[1], quat1[2], quat1[3],
quat0[0], quat0[1], quat0[2], quat0[3],
];
const tracks: IAnimationTrack[] = [
{
times: times,
node: doorChildNode,
values: values,
path: "rotation",
interpolation: "linear",
pivot: pivot_animation
}
];
const data = new AnimationData("DoorHandleRotationAnimation", tracks, 0, 6);
session.node.data.push(data);
For drawers-
const times = [0, 1, 2, 3];
const values = [
start.x, start.y, start.z,
start.x, start.y - amplitude, start.z,
start.x, start.y - amplitude, start.z,
start.x, start.y, start.z
];
const tracks: IAnimationTrack[] = [
{
times: times,
node: doorChildNode,
values: values,
path: "translation",
interpolation: "linear"
}
];
const data = new AnimationData("DoorHandleRotationAnimation", tracks, 0, 6);
session.node.data.push(data);
Is this a glitch of shapediver or animation issue?
Can you guys help me finding why it’s happening and how to solve this?