none
Is this a good solution? RRS feed

  • Question

  • yo!

    i just coded a simple spring! and i want to know if this is a good solution for it: MZS896 (i know, it works only for the y axis and the car doesnt rotate, but that might be changed one day..)

    its a kinda stupid solution if you ask me. but it works very well!

    btw, you can set the amount of wheels on the top of the code.
    Live for nothing, OR CODE FOR SOMETHING!
    • Edited by Dudeson Thursday, November 26, 2009 8:46 PM
    Thursday, November 26, 2009 8:01 PM

Answers

  • One thing, try the following for the wheel rotation to look more natural:

    Shapes.Rotate(Wheel[i],Wheel_X[i]*(180 /(Pi*35)))

    perimeter = 2.pi.r (2.pi is a full circle)

    therefore distance travelled (Wheel_X) = angle.r, where r = 35

    angle= Wheel_X/35, this is radians so in degrees angle= Wheel_X*180/(pi*35)
    • Marked as answer by Dudeson Thursday, December 3, 2009 9:53 PM
    Friday, November 27, 2009 9:16 PM
    Moderator

All replies

  • Haven't looked through the code, but the effect is good. Nice one Dudeson.
    Thursday, November 26, 2009 8:44 PM
  • thank you^^
    Live for nothing, OR CODE FOR SOMETHING!
    Thursday, November 26, 2009 8:45 PM
  • One thing, try the following for the wheel rotation to look more natural:

    Shapes.Rotate(Wheel[i],Wheel_X[i]*(180 /(Pi*35)))

    perimeter = 2.pi.r (2.pi is a full circle)

    therefore distance travelled (Wheel_X) = angle.r, where r = 35

    angle= Wheel_X/35, this is radians so in degrees angle= Wheel_X*180/(pi*35)
    • Marked as answer by Dudeson Thursday, December 3, 2009 9:53 PM
    Friday, November 27, 2009 9:16 PM
    Moderator
  • uhm..

    but isnt that the same?
    Live for nothing, OR CODE FOR SOMETHING!
    Friday, November 27, 2009 9:26 PM
  • you had: Shapes.Rotate(Wheel[i],Wheel_X[i]*(360 /(Pi*35)))
    Friday, November 27, 2009 9:28 PM
    Moderator
  • ohh! i totally forgot that this is the old version... i have Shapes.Rotate(Wheel[i],Wheel_X[i]*(360 /(Pi*70))) now.

    sry..

    Live for nothing, OR CODE FOR SOMETHING!
    Friday, November 27, 2009 9:31 PM