Skip to main content
Tweeted twitter.com/#!/StackBlender/status/577673664419741696
deleted 50 characters in body; edited tags; edited title
Source Link
David
  • 49.7k
  • 40
  • 162
  • 318

Setting A Circle's Rotation From A Changing Number in the BGE

I have a timer that counts from 82 to -82 and back.

And
And I have a circle that should rotate (x rotation) from 82 to -82 and back.

-> How can I assign the timer number to the x rotation number of the circle?

My code so far is:

cont = bge.logic.getCurrentController()

circle = cont.owner

matrix_rotation = circle.worldOrientation

euler_rotation = matrix_rotation.to_euler()

degrees_rotation = [math.degrees(a) for a in euler_rotation]

circleRotation = int(degrees_rotation[1])

Now I want to reverse the steps but don't know how to do it. The timer is driven by the system time and the circle should spin accordingly (it is kind of a skybox).

Has anybody an idea? Thank you in advance!

Setting A Circle's Rotation From A Changing Number

I have a timer that counts from 82 to -82 and back.

And I have a circle that should rotate (x rotation) from 82 to -82 and back.

-> How can I assign the timer number to the x rotation number of the circle?

My code so far is:

cont = bge.logic.getCurrentController()

circle = cont.owner

matrix_rotation = circle.worldOrientation

euler_rotation = matrix_rotation.to_euler()

degrees_rotation = [math.degrees(a) for a in euler_rotation]

circleRotation = int(degrees_rotation[1])

Now I want to reverse the steps but don't know how to do it. The timer is driven by the system time and the circle should spin accordingly (it is kind of a skybox).

Has anybody an idea? Thank you in advance!

Setting A Circle's Rotation From A Changing Number in the BGE

I have a timer that counts from 82 to -82 and back.
And I have a circle that should rotate (x rotation) from 82 to -82 and back.

How can I assign the timer number to the x rotation number of the circle?

My code so far is:

cont = bge.logic.getCurrentController()

circle = cont.owner

matrix_rotation = circle.worldOrientation

euler_rotation = matrix_rotation.to_euler()

degrees_rotation = [math.degrees(a) for a in euler_rotation]

circleRotation = int(degrees_rotation[1])

Now I want to reverse the steps but don't know how to do it. The timer is driven by the system time and the circle should spin accordingly (it is kind of a skybox).

Source Link
Sputi
  • 451
  • 3
  • 13

Setting A Circle's Rotation From A Changing Number

I have a timer that counts from 82 to -82 and back.

And I have a circle that should rotate (x rotation) from 82 to -82 and back.

-> How can I assign the timer number to the x rotation number of the circle?

My code so far is:

cont = bge.logic.getCurrentController()

circle = cont.owner

matrix_rotation = circle.worldOrientation

euler_rotation = matrix_rotation.to_euler()

degrees_rotation = [math.degrees(a) for a in euler_rotation]

circleRotation = int(degrees_rotation[1])

Now I want to reverse the steps but don't know how to do it. The timer is driven by the system time and the circle should spin accordingly (it is kind of a skybox).

Has anybody an idea? Thank you in advance!