Skip to content

Instantly share code, notes, and snippets.

@aburok
Created December 26, 2015 08:29
Show Gist options
  • Save aburok/2c99d8b877194fcfaf42 to your computer and use it in GitHub Desktop.
Save aburok/2c99d8b877194fcfaf42 to your computer and use it in GitHub Desktop.
sketchyphysics koparka model
if frame < 1.00
@SlideBase = 1.00
@SlideBaseStep = 0.01
@RotBase = 0.5
@RotBaseStep = 0.002
@SliderArm1 = 1
@SliderArm1Step = 0.01
@RotArm2 = 1
@RotArm2Step = 0.01
@RotHand = 0.5
@RotHandStep = 0.01
@SlideHand = 0
@SlideHandStep = 0.01
end
#############################
# Robot Base Rotation
#############################
if key("e") == 1 && @SlideBase < 1 - @SlideBaseStep
@SlideBase += @SlideBaseStep
end
if key("q") == 1 && @SlideBase > 0 + @SlideBaseStep
@SlideBase -= @SlideBaseStep
end
#############################
# Robot Base Rotation
#############################
if key("d") == 1 && @RotBase < 1 - @RotBaseStep
@RotBase += @RotBaseStep
end
if key("a") == 1 && @RotBase > 0 + @RotBaseStep
@RotBase -= @RotBaseStep
end
#############################
# Robot FIrst Arm Rotation
#############################
if key("w") == 1 && @SliderArm1 < 1 - @SliderArm1Step
@SliderArm1 += @SliderArm1Step
end
if key("s") == 1 && @SliderArm1 > 0 + @SliderArm1Step
@SliderArm1 -= @SliderArm1Step
end
#############################
# Robot Second Arm Rotation
#############################
if key("up") == 1 && @RotArm2 < 1 - @RotArm2Step
@RotArm2 += @RotArm2Step
end
if key("down") == 1 && @RotArm2 > 0 + @RotArm2Step
@RotArm2 -= @RotArm2Step
end
#############################
# Robot Hand Rotation & grip
#############################
if key("right") == 1 && @RotHand < 1 - @RotHandStep
@RotHand += @RotHandStep
end
if key("left") == 1 && @RotHand > 0 + @RotHandStep
@RotHand -= @RotHandStep
end
if key("Space") == 1 && key("Shift") == 0 && @SlideHand < 1 - @SlideHandStep
@SlideHand += @SlideHandStep
end
if key("Space") == 1 && key("Shift") == 1 && @SlideHand > 0 + @SlideHandStep
@SlideHand -= @SlideHandStep
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment