Skip to content

Instantly share code, notes, and snippets.

@AGoblinKing
Created August 18, 2012 02:59
Show Gist options
  • Save AGoblinKing/3384072 to your computer and use it in GitHub Desktop.
Save AGoblinKing/3384072 to your computer and use it in GitHub Desktop.
@joints = {}
for key, value of zig.Joint
material = new THREE.MeshBasicMaterial
color: "0xFF0000"
@joints[value] = new THREE.Mesh (new THREE.SphereGeometry 50, 10, 10), material
@joints[value].position.set 0,0,0
@body.add @joints[value]
engage = zig.EngageUsersWithSkeleton 1
engage.addEventListener "userengaged", (user) =>
user.addEventListener "userupdate", (user) =>
for key, value of user.skeleton
pos = value.position
@joints[key].position.set pos[0], pos[1], pos[2]
engage.addEventListener "userdisengaged", (user) ->
console.log "lost user"
zig.addListener engage
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment