rotation in bones

hi! first excuse my english. I have the problem with rotations bones. I am make exercises create bones, but if a reference point has a negative value in the Z axis, the bone creates a rotation. How I can correct this rotation? this is code:
refPoint05 = point pos:[0,0,65] size:3 wirecolor:[246,255,0] name:"refPoint05"
refPoint04 = point pos:[0,0,60] size:3 wirecolor:[246,255,0] name:"refPoint04"
refPoint03 = point pos:[0,0,40] size:3 wirecolor:[246,255,0] name:"refPoint03"
refPoint02 = point pos:[0,-1,20] size:3 wirecolor:[246,255,0] name:"refPoint02" --- negative value
refPoint01 = point pos:[0,0,0] size:3 wirecolor:[246,255,0] name:"refPoint01"
refArray = #(refPoint01,refPoint02,refPoint03,refPoint04,refPoint05)

bonesArray = #()
for i = 1 to 4 do
(
b = boneSys.createBone refArray[i].pos refArray[i+1].pos refArray[i].Transform[3]
append bonesArray b
if i>1 then b.parent=bonesArray[i-1]
b.frontfin=true
b.name = uniquename "Bone"
)

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
jmpinero's picture

many thanks, I was going

many thanks, I was going crazy. I owe you a beer, when you come to Sevilla : D

ikerclon's picture

Change this: b =

Change this:
b = boneSys.createBone refArray[i].pos refArray[i+1].pos refArray[i].Transform[3]

into this:
b = boneSys.createBone refArray[i].pos refArray[i+1].pos refArray[i].Transform[1]

Actually, the third argument on 'createBone'is the upnode axis of the bone, so it does not make sense that you set it to be the axis that points towards the next one but the perpendicullar one.

Hope it helps...

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.