Question: Get real pitch angle after rotate yaw

Everything related to 3D programming
User avatar
minimy
Enthusiast
Enthusiast
Posts: 619
Joined: Mon Jul 08, 2013 8:43 pm
Location: off world

Question: Get real pitch angle after rotate yaw

Post by minimy »

Hello and happy new year guys!!
I have a problem when use rotation.
Example: When rotate pitch, if rotate yaw, all rotation angles change. Test with absolute and relative and result is some.
Any way to get the real angle of pitch?
Thanks for help.
If translation=Error: reply="Sorry, Im Spanish": Endif
User avatar
SPH
Enthusiast
Enthusiast
Posts: 571
Joined: Tue Jan 04, 2011 6:21 pm

Re: Question: Get real pitch angle after rotate yaw

Post by SPH »

Without code, it's hard to anserw you

!i!i!i!i!i!i!i!i!i!
!i!i!i!i!i!i!
!i!i!i!
//// Informations ////
Portable LENOVO ideapad 110-17ACL 64 bits
Version de PB : 6.12LTS - 64 bits
User avatar
STARGÅTE
Addict
Addict
Posts: 2232
Joined: Thu Jan 10, 2008 1:30 pm
Location: Germany, Glienicke
Contact:

Re: Question: Get real pitch angle after rotate yaw

Post by STARGÅTE »

EntityPitch has two modes: #PB_Engine3D_Raw and #PB_Engine3D_Adjusted
PB 6.01 ― Win 10, 21H2 ― Ryzen 9 3900X, 32 GB ― NVIDIA GeForce RTX 3080 ― Vivaldi 6.0 ― www.unionbytes.de
Lizard - Script language for symbolic calculations and moreTypeface - Sprite-based font include/module
User avatar
minimy
Enthusiast
Enthusiast
Posts: 619
Joined: Mon Jul 08, 2013 8:43 pm
Location: off world

Re: Question: Get real pitch angle after rotate yaw

Post by minimy »

This is my simple solution, I know it's not the best, but for now it works for me

Code: Select all

      
      pitch.f= EntityPitch(entity,#PB_Engine3D_Adjusted)
      If pitch>=90 Or pitch<=-90: pitch-180:EndIf
      If pitch<=-300: pitch+360:EndIf
If translation=Error: reply="Sorry, Im Spanish": Endif
Post Reply