In-depth introduction to game algorithms (4)-unity3d algorithms (1)-ball rotation, in-depth introduction-unity3d
Ball rotation
Place the unity3d components in the following layout, and set the rendering, position, light source, and size.
All contents of the good AI Park blog is original, if reproduced please indicate the source http://blog.csdn.net/myhaspl/
Write the following code:
# Pragma strict
Function Start (){
This. Start ();
}
Function Update (){
This. transform. Rotate (1, 1,-1 );
}
The effect is shown in the link:
Http://mygame.myhaspl.com/test1/test1.html
You can also create a rotation object and select this object in the property box.
The Code is as follows:
# Pragma strict
Var tf_object: GameObject;
Function Update (){
Tf_object.transform.Rotate (1, 1,-1 );
}
1-[9/10-(3/4-1/6)] Simple Algorithm Calculation
1-[9/10-(3/4-1/6 )]
= 1-9/10 + 3/4-1/6
= 1/10 + 9/12-2/12
= 1/10 + 7/12
= 6/60 + 35/60
= 41/60
(1 to 4 in 3) + (1 to 5 in 4) + (1 to 6 in 5)
(1/3-1/4) + (1/4-1/5) + (1/5-1/6)
= 1/3-1/4 + 1/4-1/5 + 1/5-1/6 = 1/3-1/6 = 1/6