DzQuat question

bradrgbradrg Posts: 606

 

I have the following 2 scripts that find a node (merlins skull) and rotates it 90 degrees. the second uses an overloaded version of DzQuad

var nNode=Scene.findNode('MRLN_MSSkull_7542');

nNode.setLocalRot(DzQuat(0,1,0,Math.PI/2);

 

var nNode=Scene.findNode('MRLN_MSSkull_7542');

nNode.setLocalRot(DzQuat( DzVec3(0,1,0),(Math.PI/2)));

 

As you can see from the attached image, they give different results. 

image one is starting position, two is script 1 and three is script 2. (script 2 is how I would expect it to behave.) 

 

khan.jpg
1112 x 300 - 142K
Post edited by bradrg on

Comments

  • jag11jag11 Posts: 747

    Movement is contrained by ERC or riggin, disable YRotation(Twist control) limits for that node.

  • bradrgbradrg Posts: 606
    edited October 2017

    it seems to be doing it even with a primitive cube- with no limits or rigging. 

    khan.jpg
    886 x 850 - 236K
    Post edited by bradrg on
  • jag11jag11 Posts: 747

    I tested it and you are right, I think you've found a bug, now you can go reclaim your CS report number. wink

  • bradrgbradrg Posts: 606

    Submitted laugh

  • DAZ_cjonesDAZ_cjones Posts: 607
    edited October 2017

    The first constructor you use with four values directly sets the 4 values of the quaterion directly (equivalent to setter "setValue(x,y,z,w)").

    The second constructor is creating a quaterion by converting an axis and angle pair to a quaterion (equivalent to the setter "setValue(DzVec3 axis, double radians)").

    They should almost always yeild a different results from each other, when given the same numbers.

    Post edited by DAZ_cjones on
  • bradrgbradrg Posts: 606

    Thanks for getting back to us on this. 

Sign In or Register to comment.