Skip to content

Instantly share code, notes, and snippets.

@RomainKurtz
Last active September 2, 2015 09:16
Show Gist options
  • Select an option

  • Save RomainKurtz/388c5a9c3903f5812d97 to your computer and use it in GitHub Desktop.

Select an option

Save RomainKurtz/388c5a9c3903f5812d97 to your computer and use it in GitHub Desktop.
Compute the center of two points (vector3: x,y,z) in 3D space
//To compute the center of two points (vector3: x,y,z) in 3D space
function centerAB (A,B){
var x = ((A.x+B.x)/2);
var y = ((A.y+B.y)/2);
var z = ((A.z+B.z)/2);
return new THREE.Vector3(x,y,z);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment