WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 08-21-2008, 01:25 PM
sscovil sscovil is offline
Member
 
Join Date: Apr 2008
Posts: 7
Bone Rotations

Hello,

When I run the following code, I don't get 0,0,0 output as I expect.

Code:
male = viz.add('vcc_male.cfg')
male.setEuler([0,0,0])
male.setPosition([0,0,0])
male_pelvis = male.getBone('Bip01 Pelvis')
male_pelvis.lock()
male_pelvis.setEuler([0,0,0],viz.ABS_PARENT)
male_pelvis.setEuler([0,0,0],viz.ABS_GLOBAL)

print male_pelvis.getName()
print male_pelvis.getEuler(viz.ABS_PARENT)
print male_pelvis.getEuler(viz.ABS_GLOBAL)
print '\n'
Even if I add a 'male_pelvis.setEuler([0,0,0],viz.AVATAR_WORLD)' to it, it gives different numbers but still not 0,0,0. I'm thinking I don't understand how it works. Can you explain to me how the different 'rotation spaces' work, and why this isn't outputting 0,0,0?

Thanks,

Stephen
Reply With Quote
  #2  
Old 08-22-2008, 10:24 AM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
I ran the following code:
Code:
male_pelvis.setEuler([0,0,0],viz.ABS_PARENT)
print male_pelvis.getEuler(viz.ABS_PARENT)

male_pelvis.setEuler([0,0,0],viz.ABS_GLOBAL)
print male_pelvis.getEuler(viz.ABS_GLOBAL)

male_pelvis.setEuler([0,0,0],viz.AVATAR_WORLD)
print male_pelvis.getEuler(viz.AVATAR_WORLD)
And got the following output:
Code:
[0.0, 0.0, 0.0]
[-3.4150864394177916e-006, 0.0, 0.0]
[-2.4426660780868525e-012, 6.5951979988376763e-011, 0.0]
All those values are equivalent to [0,0,0], so I'm not sure what exactly the problem is.
Reply With Quote
  #3  
Old 08-25-2008, 06:39 AM
sscovil sscovil is offline
Member
 
Join Date: Apr 2008
Posts: 7
Ok, I think I kinda see. So each bone has a few different rotations that are combined? Like, it has its own, then gets rotated by the avatar world rotation? Since without the WORLD one, the code I originally posted gave me this:

[90.0, 8.8792461610864848e-005, -90.0]
[-3.4150864394177916e-006, 0.0, 0.0]

Even though I set the GLOBAL to 0,0,0. How come?
Reply With Quote
  #4  
Old 08-25-2008, 06:04 PM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
No, each bone has a single position/rotation. The different mode options simply specify in which coordinate frame you want to set the value of the bone. In your code the line:
Code:
male_pelvis.setEuler([0,0,0],viz.ABS_PARENT)
does nothing because you change the bone rotation in next line using viz.ABS_GLOBAL mode. The 2 values are different because viz.ABS_PARENT is getting the bone rotation in the parent bones coordinate frame and viz.ABS_GLOBAL is getting the rotation in the global coordinate system (which accounts for parent bone and avatar rotation)
Reply With Quote
  #5  
Old 08-27-2008, 10:23 AM
sscovil sscovil is offline
Member
 
Join Date: Apr 2008
Posts: 7
Ok, that's what I needed to know. Thanks!
Reply With Quote
  #6  
Old 05-19-2016, 04:07 AM
S_L_A__IKP_23o S_L_A__IKP_23o is offline
Registered User
 
Join Date: May 2016
Posts: 1
Exclamation Bones transforms_behave_differently_to node3d

From <node3d>.getEuler() and <node3d>.setEuler(), the viz.ABS_PARENT transform mode works in the PARENT's coordinate system.
But for <bone>.getEuler() and <bone>.setEuler(), the viz.ABS_PARENT transform mode works in the LOCAL coordinate system.
Reply With Quote
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Locking every bone of a character Frank Verberne Vizard 2 03-17-2008 10:21 AM
vcc avatars: defining bone length bjgold Vizard 1 08-08-2007 11:24 AM
Avatar bone rotations respect to world MiamiTodd Vizard 3 02-14-2006 10:41 AM
rotations in vizard david Vizard 7 02-24-2005 09:57 AM
vizard rotations duda Vizard 5 09-03-2003 02:31 PM


All times are GMT -7. The time now is 06:48 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Copyright 2002-2023 WorldViz LLC