3

I am observing a rotation value of a character in a game, and its value confuses me.

I am wondering, what kind of unit is used here? It does not seem to be radian or degrees.

When the character faces...
north, rotation = 0.014887573
north-east, rotation = -0.28192267
east, rotation = -0.7139419
south-east, rotation = -0.9176189
south, rotation = -0.99983466
west, rotation = 0.6936041
south-west, rotation = 0.90622354
north-west, rotation = 0.36119097

There appears to be somekind of exponential increase when facing a more southern rotation. Does this scale make sense to anyone?

Update: there appears to be another variable which somehow seems to resolve the actual rotation when multiplied with the above value when facing east or north. If mulitplied, when facing west the value will be 0.5 and when facing east it will be -0.5.

However, this multiplier becomes 0 when facing south and 1 when facing north, so when you multiple that with the first value they both become 0.

What kind of rotation representation uses multiple values in a 3D scene?

Tom
  • 8,536
  • 31
  • 133
  • 232
  • If you start south then move round the east, north, west then back to south it goes from -1 to 1 – Harold Mar 16 '11 at 13:48
  • True, but the scale inbetween does not seem to make much sense. Or does it? The increments are not linear. – Tom Mar 16 '11 at 13:51
  • 1
    If the character is moving in a 3D world, then the camera position might cause this non-uniformity. – Itamar Katz Mar 16 '11 at 13:55
  • @Itamar, that would make sense. So probably I am looking at the wrong values. I shall investigate, thanks! – Tom Mar 16 '11 at 13:56
  • @Itamar, after testing it appears that the camera has no effect on the value at all. It only appears to be actual rotation of the character. – Tom Mar 16 '11 at 14:12
  • I updated the original question as I found another value which is related. – Tom Mar 16 '11 at 14:35
  • Added my own answer, arc sine seems to do something senseful! – Tom Mar 16 '11 at 15:07

1 Answers1

0

When calculating the arc sine of the above values it seems to make more sense.

North will become 0 South will become 90

West will become 45 East will become -45

I question though, why is the scale from 0 to 90 (north to south) and not from 0 to 180?

Tom
  • 8,536
  • 31
  • 133
  • 232