Tuesday, 2 August 2016

03/08/2016 Hand Scripting




The first code I tried out required the right click and moved to the centre of the screen instead of following the mouse. (I later discovered that the perspective view of the game would not allow the desired mouse movement due to the plane of movement not being set)









Combining the first script, the second script my lecturer found,and working that into the current game manager script created a rotating hand that spins on a 360 axis looking towards the mouse.

Next steps will be mouse distance restrictions,to create a bubble collider/area the mouse can move in.






A pseudo software mouse was created to not interfere with actual mouse use while editing.
This software mouse was limited to a set X and Y minimum and maximum value.

This result is similar the the middle square gif below,showing how jagged the movement is currently.

The equation to turn the x and y into radius is X² xY²=R²

Not sure if the radius is equivalent to the magnitude or lerp from the center.

"The center-radius form of the circle equation is in the format (x – h)2 + (y – k)2 = r2, with the center being at the point (h, k) and the radius being "r". This form of the equation is helpful, since you can easily find the center and the radius." - Purple math

circumference:
2pie x R / pie x D

I think restraining the mouse could be done with no axis. a set maximum distance in any direction from the centre point.









No comments:

Post a Comment