Browse Search Popular Register Upload Rules User list Login:
Search:
please help with angle.

Image:
screenshot of the scene

Author: TheLeandroNex01

Group: Default

Filesize: 351.39 kB

Date added: 2014-03-04

Rating: 5

Downloads: 963

Views: 286

Comments: 5

Ratings: 1

Times favored: 0

Made with: Algodoo v2.1.0

Tags:

Scene tag

please help
if you keep pressing left or right the road(or wahtaever) is reseted!
Please log in to rate this scene
edit
Similar scenes
Title: stepper motor
Rating: 5.7778
Filesize: 22.29 kB
Downloads: 503
Comments: 2
Ratings: 3
Date added: 2009/12/06 21:35:11
Made with: Algodoo before v1.8.5
Rating: rated 5.8
download
Title: scripted servo [algodoo]
Rating: 6.1111
Filesize: 40.57 kB
Downloads: 621
Comments: 6
Ratings: 3
Date added: 2010/05/16 11:54:21
Made with: Algodoo before v1.8.5
Rating: rated 6.1
download
Title: Sim not running , angle working [2.1.0+]
Rating: 5
Filesize: 41.54 kB
Downloads: 361
Comments: 2
Ratings: 1
Date added: 2013/05/13 15:00:48
Made with: Algodoo before v1.8.5
Rating: rated 5
download
Title: Gyroscope
Rating: 6.4
Filesize: 65.09 kB
Downloads: 1564
Comments: 1
Ratings: 4
Date added: 2009/04/28 12:55:48
Made with: Phun
Rating: rated 6.4
download
Title: Artillery Game
Rating: 8.1003
Filesize: 377.62 kB
Downloads: 5735
Comments: 19
Ratings: 23
Date added: 2009/05/04 04:59:10
Made with: Phun
Rating: rated 8.1
download
Title: Nuke Launcher
Rating: 5
Filesize: 444.86 kB
Downloads: 2246
Comments: 1
Ratings: 1
Date added: 2017/08/21 14:29:51
Made with: Algodoo v2.1.0
Rating: rated 5
download
help me
It's because the angle property of a circle has a range of -pi to +pi (a total of 2pi) radians. So, when you continue to turn in one direction, the angle switches from negative to positive or vice-versa depending on which direction you are turning. Depending on how your scene works (I have not looked at it in detail) you may want to convert radians to degrees and use that value for controlling how the car turns.
Okay, I looked over your scene and here is what I found:

1. You put the same script in 12 different geometries within the steering wheel assembly! :o That happened because all of the parts of the steering wheel are grouped together. So, when you select the steering wheel, you are selecting the 12 separate components of it. Then when you added the script scene.my.phaseAngle = angle to postStep, you added it to 12 geometries. Each one was in conflict with all the others.

2. The script scene.my.phaseAngle = angle will not work because of the point I made in my previous comment. You need to convert it to degrees, and then adjust the result so that it gives you the range of the spring length that you need to move the road left and right.

After deleting all 12 scripts in the steering wheel, I selected only the small circle in the middle (you select one object in a group by holding down the Alt key while clicking on the object that you want to select). Then I added the following script to postStep: scene.my.phaseangle = (180 + angle * (180) / math.pi) / 36 This will give you a range of 0 to 10 when you rotate the steering wheel completely around. I estimated that at full stretched length, the spring at the top of the road needs to be about 10 inches. On the other end of the spring length value, it cannot be allowed to be zero, and so at the spring Length property, I added the script: {scene.my.phaseAngle + 4.0}. That should give you about the correct range, but you might need to adjust it.

So, that's what I've done for you so far. I do not have the time nor the desire to rework your entire scene, and so I will leave the rest up to you. This will get you in the ball park, but you will still need to make some adjustments. Again, be careful when selecting objects in Algodoo because you might accidentally select more than one object which can get you into trouble if you did not realize it!
tanks _o_
:)
Last edited at 2015/10/13 04:11:32 by TheLeandroNex01