Rotating Counter Clockwise
I am making a game Radar Hud, but I have run into a problem. I rotate clockwise instead of counter clockwise. Could someone point me into the right direction of how to solve my problem.
Thanks,
N
Quote:I am making a game Radar Hud, but I have run into a problem. I rotate clockwise instead of counter clockwise. Could someone point me into the right direction of how to solve my problem.We'll probably need some more info; rotating clockwise instead of counterclockwise is trivial (just rotate the other way), so I'm guessing there's more going on here than is evident from your post.
Can you describe the problem in more detail?
Here is my rotation code.
ab[0] and ab[1] is the difference between a and b (a - b)
abc[0] = ab[0] * cos(c) - ab[1] * sin(c);
abc[1] = ab[0] * sin(c) + ab[1] * cos(c);
I hope this helps you help m.
EDIT: I found out if I negate Cosine it will rotate counter clockwise, but I want to find a more "conventional" way of rotating counter clockwise.
ab[0] and ab[1] is the difference between a and b (a - b)
abc[0] = ab[0] * cos(c) - ab[1] * sin(c);
abc[1] = ab[0] * sin(c) + ab[1] * cos(c);
I hope this helps you help m.
EDIT: I found out if I negate Cosine it will rotate counter clockwise, but I want to find a more "conventional" way of rotating counter clockwise.
Sorry, but that still did not fix my problem. What if I tried something like this..
if (abc[0] > 0)
{
abc[0] -= 360;
}
else if (abc[0] < 0)
{
abc[0] += 360;
}
if (abc[1] > 0)
{
abc[1] -= 360;
}
else if (abc[1] < 0)
{
abc[1] += 360;
}
Thanks,
N
if (abc[0] > 0)
{
abc[0] -= 360;
}
else if (abc[0] < 0)
{
abc[0] += 360;
}
if (abc[1] > 0)
{
abc[1] -= 360;
}
else if (abc[1] < 0)
{
abc[1] += 360;
}
Thanks,
N
Earlier you were treating abc as a vector, but in the above example you seem to be treating it as a pair of angles...?
In any case, I'm afraid I don't really understand the problem that you're trying to solve. If you could explain the problem in more detail, it might make it easier for us to offer suggestions as to how to solve it.
In any case, I'm afraid I don't really understand the problem that you're trying to solve. If you could explain the problem in more detail, it might make it easier for us to offer suggestions as to how to solve it.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement