# Questiondifference in normal graphics and D3d9

#### gattispilot

So why do somethings work great in normal graphics but run it in d3d9. They don't work? for instance in regular graphics the lander from the Endurance space system has a rotating chair. but in d3d9 the chair doesn't animate. Same code.
Code:
if (chairrot == 1)    {
VECTOR3 weight_v;
GetWeightVector(weight_v);

double const current_g = MAGNETUDE(weight_v) / GetMass();
double const angle = ((current_g < 0.98) ? PI : atan2(weight_v.x, weight_v.y));
double const radians = (angle / PI);
{
double const anim = 1 - abs(((radians < 0) ? -0.5 : 0.5) + abs(radians / 2));
SetAnimation(anim_PILOTCHAIR, anim);
SetAnimation(anim_COPILOTCHAIR, anim);

sprintf(oapiDebugString(), "chairrot %d; anim %lf;", chairrot, anim);

}
}
I can see the anim change but the anim_PILOTCHAIR isn't moving in d3d9

#### GLS

You should read the documentation of SetAnimation(), especially the part about argument limits...

#### gattispilot

documents in d3d9? if it matters this is happening in 2010.

#### GLS

documents in d3d9? if it matters this is happening in 2010.

My guess is that this isn't related to graphics engines or Orbiter versions, but to the value of "anim": it has to be between 0 and 1. If it is outside that range... well, some weird thing might happen, or it might crash, or it might not animate, and what happens can easily be different in MOGE and D3D9.

#### gattispilot

Ok. yes the animation state is between 0 and 1. But I works in normal graphics but not in D3d9?

#### GLS

Ok. yes the animation state is between 0 and 1. But I works in normal graphics but not in D3d9?
If that is correct, then something else is wrong.