Jump to content
  • Advertisement

DAddill

Member
  • Content Count

    1
  • Joined

  • Last visited

Community Reputation

0 Neutral

About DAddill

  • Rank
    Newbie

Personal Information

  • Interests
    Programming

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. I'm trying to understand how maya, blender, unity etc get new eulers in widget while user rotate model in local coordinate system by gizmo in viewport. This applications somehow save rotate in eulers but perform operation in quaternions. I can't understand how they save/convert quaternion to eulers and get eulers more than 180 degree If i simplest convert result quaternion to eulers i can't get result like in applications above. I can't get angle more 180 Unity for example https://monosnap.com/file/oHigb8FSwopYTZCBjOQLqvh58vbQ8Z This is my code explain my attemps to do that. Quaternion rotation; //relative (local rotation) Vector3 eulersRotation; Quaternion parentRotation; //it is psevdo code where we calculate delta angle that user generate on current frame by mouse void SetDeltaWorldRotationFromUserInput(Quaternion value) { SetWorldRotation(value); } void SetWorldRotation(Quaternion value) { SetLocalRotation(parentQuaternion.inverted() * value); //set local rotation } void SetLocalRotation(Quaternion value) { rotation = value; // we save new local rotation but i want to save somehow more then 180 degree auto eulersForGui = value.toEulers(); //it is current eulers but i want to accumulate and show in gui accumulate rotation. like currentRotation + delta or somehow auto deltaEulers = (value * rotation.inverted()).toEulers(); //i can get delta eulers but i can't add it to euelers and don't know what i need to do with this value eulersRotation += deltaEulers; //it is similar wrong. I don't know how to do it correctly }
  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!