Last active
August 4, 2016 21:06
-
-
Save natecraddock/68a7b88fc329bf92027662e5f5102339 to your computer and use it in GitHub Desktop.
Returns the distance between two objects in Blender
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import math | |
| def pythagorean(object1, object2): | |
| dx = object1.location.x - object2.location.x | |
| dy = object1.location.y - object2.location.y | |
| dz = object1.location.z - object2.location.z | |
| return math.sqrt(pow(dx, 2) + pow(dy, 2) + pow(dz, 2)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment