Digital Art Zone

 
     
World-Space-Coordinate-System using setWSRot() has a wrong? outcome.
Posted: 30 August 2014 01:39 PM   [ Ignore ]
New Member
Total Posts:  4
Joined  2011-06-24

Hello,

I don’t understand the world-space coordinate system in DAZ3d at the moment. I searched in the documentation but found nothing what helped me so far. I hope someone can explain it to me.

I tried for some experimentations to set the left shoulder to -45° with the following code. I assumed the rotation would be given in RAD. Found nothing about the unit in the documentation. Maybe I searched in the wrong place?
I used a Genesis 2 Male for this.

QString lShoulder "Left Shoulder";
DzNode *nodelShoulder dzScene->findNodeByLabel(lShoulder);
nodelShoulder->setWSRot(DzTime(0),DzQuat(0.0f*DZ_FLT_DEG_TO_RAD,0.0f*DZ_FLT_DEG_TO_RAD,-45.0f*DZ_FLT_DEG_TO_RAD,true)); 

The outcome was as followed:
Twist: -5.99
Front-Back: -4.78
Bend: -75.0 (seems to be maximum)

After this I tried it without conversion to RAD

QString lShoulder "Left Shoulder";
DzNode *nodelShoulder dzScene->findNodeByLabel(lShoulder);
nodelShoulder->setWSRot(DzTime(0),DzQuat(0.0f,0.0f,-45.0f,true)); 

The outcome was as followed:
Twist: -0.13
Front-Back: -12.41
Bend: -75.0

I expected the outcome would be
Twist: 0
Front-Back: 0
Bend: -45.0
Why isn’t it this way?

Profile
 
 
Posted: 02 September 2014 12:29 PM   [ Ignore ]   [ # 1 ]
Member
Rank
Total Posts:  96
Joined  2010-12-31

Hmm, I think you are using the wrong DzQuat constructor.  Something like this is probably what you where trying to do.

QString lShoulder "Left Shoulder";
DzNode *nodelShoulder dzScene->findNodeByLabel(lShoulder);
nodelShoulder->setWSRot(DzTime(0), DzQuat(nodelShoulder->getRotationOrder(), DzVec3(0.0f,0.0f,-45.0f DZ_FLT_DEG_TO_RAD))); 


Better would be:

QString lShoulder "Left Shoulder";
DzNode *nodelShoulder dzScene->findNodeByLabel(lShoulder);
nodelShoulder->getXRotControl()->setValue(0);
nodelShoulder->getYRotControl()->setValue(0);
nodelShoulder->getZRotControl()->setValue(-45); 
Profile
 
 
Posted: 04 September 2014 07:02 AM   [ Ignore ]   [ # 2 ]
New Member
Total Posts:  4
Joined  2011-06-24

Hi,

I just tested it. Your were right. I used a wrong constructor.

now It’s working the way I had in mind.

Thanks for your help!

Profile