Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / Gimbal Lock, the baddest enemy..

Author
Message
Alduce
23
Years of Service
User Offline
Joined: 26th Oct 2002
Location: Rama spaceship
Posted: 3rd Feb 2013 10:32
Hi all.
From my previous thread about to find angle values of my airplane without the weird "gimbal lock" (that affect the axis each other..) I tried really a mountain of tests.. my only result is frustration and frustration again. I was sure that "Le Verdier" code solved my problems but I was just wrong.

I try with ExtendRotation, EZrotate basic and just with some math tricks (except matrix angles because I have not the slightest idea about) but the hard reality is that I have a really far idea about what the hell I am doing.

I have really little math and geometry knowledge and I feel as someone blindfolded trying to avoid bear traps... without chances..

My problem is "simple" in the theory;
I just would to have:

1) each of my axis as SINGLE AND INDEPENDENT.
example : Z ANGLE not affected by X or Y ANGLES.
(If Y angle is upper than 90 so my Z ANGLE become 180 ecc ecc)


2) each of my angles values just from 0 to 360.

Please, consider that I move my airplane by external forces so NOT USING rotate, move, pitch, roll DarkBasic commands. I just would TO KNOW the values of my X, Y and Z airplane angles.

I think this is the baddest battle against DarkBasicPro.
I hope, with your help, to get the final solution about! HELP!

PS:
I can use eXtendRotation and EZrotate BASIC too. (EZrotate basic have not all the commands of the EZrotate FULL)
mr Handy
18
Years of Service
User Offline
Joined: 7th Sep 2007
Location: out of TGC
Posted: 3rd Feb 2013 16:35
Quote: "Please, consider that I move my airplane by external forces so NOT USING rotate, move, pitch, roll DarkBasic commands."

Of course you can't move object with rotation commands.

Can you describe how your plane is "moving" (flying)?

*** Merry Chuckmas! ***
Alduce
23
Years of Service
User Offline
Joined: 26th Oct 2002
Location: Rama spaceship
Posted: 3rd Feb 2013 18:18 Edited at: 3rd Feb 2013 18:21
Hi mr Handy, sorry, I meant I don't rotate my airplane axis using DarkBasicPro commands but using DarkDynamix forces.

My airplane flying and rotate depending on how the air particles make friction with it. The air particles are thousand of really little cubes.
I am using DarkDynamix forces to push my airplane and more force is pushing my airplane then more friction happen between air particles and the airplane.
Not too far from what happen in the reality, of course using some lift force math.
So my airplane repeatedly collide with air particles objects and this make my airplane roll, pitch and yaw when I move the movable surfaces (ailerons, tail movable surfaces, flaps etc).

At this point I have not problems!
But I NEED to know the ROLL PITCH YAW or just X Y Z ANGLES values
to let me make a lot of code!
For example, I need to know the correct ROLL value to make some lift force routines about the decrease or the increase of lift of the wings according to the degrees of rotation.
Or I could to need to know the correct PITCH value to make my airplane autopilot turning on just ONLY when my pitch value is 45 degrees.
I could give you many many examples about.

In other words I NEED to know these main values to make ALL!!
Le Verdier
14
Years of Service
User Offline
Joined: 10th Jan 2012
Location: In the mosh-pit
Posted: 3rd Feb 2013 18:30 Edited at: 3rd Feb 2013 18:33
I'm afraid it is not possible.. Not in the way you think.. When rotation his handled in terms of angles and the object can be in any orientation(like an airplane), gimbal lock issues are not avoidable... (That means there is several solutions for angles values). I can help but I need to know what you want to do with the angles values.
EDIT
missed post above..

Alduce
23
Years of Service
User Offline
Joined: 26th Oct 2002
Location: Rama spaceship
Posted: 3rd Feb 2013 18:45 Edited at: 3rd Feb 2013 18:47
Quote: "
I'm afraid it is not possible.. Not in the way you think.. When rotation his handled in terms of angles and the object can be in any orientation(like an airplane), gimbal lock issues are not avoidable... (That means there is several solutions for angles values). I can help but I need to know what you want to do with the angles values.
EDIT
missed post above..
"


Hi Le Verdier, I hope to obtain another your reply now that you've read my previous post.
I have a lot of confusion in my mind about angles and gimbal...

This is a little easy and basic routine I could make about ROLL:



You can notice my code is really basic and I just would to can to check these values.
Another example if I would to make a simple artificial horizont gauge so I need to know these values!
Le Verdier
14
Years of Service
User Offline
Joined: 10th Jan 2012
Location: In the mosh-pit
Posted: 3rd Feb 2013 19:11
You can also use dot products using the axis provided by rotation matrix.
DP between unit vectors give cosinus of angle, in most case this value can be used in the calculations.
A rotation matrix is:
XAxisX XAxisY XAxisZ
YAxisX YAxisY YAxisZ
ZAxisX ZAxisY ZAxisZ

I know I'm not very helpful with this .. But I mean you have to learn to deal with vectors to get rid of the angles issues.
Will try to give an example of horizon..

Alduce
23
Years of Service
User Offline
Joined: 26th Oct 2002
Location: Rama spaceship
Posted: 3rd Feb 2013 19:49 Edited at: 3rd Feb 2013 19:50
Le Verdier thank you, can you provide me also an example of how I make and fill a matrix vector in DBPro language?...
Le Verdier
14
Years of Service
User Offline
Joined: 10th Jan 2012
Location: In the mosh-pit
Posted: 3rd Feb 2013 21:43
Either it's a matrix or it's a vector...

For a 3 component vector:
R=make vector3(1)
...
Set vector3 1, x#, y#, z#

For matrix ops, we prefer here exrot plugin..
(Read op is helpful here)
RotMatrix=dx mat(0)
...
Dbobj get rotation matrix RotMatrix, object


Ah I maybe forget something important.
Is your object scaled???

Alduce
23
Years of Service
User Offline
Joined: 26th Oct 2002
Location: Rama spaceship
Posted: 3rd Feb 2013 22:11
mmm let's see If I start to understand something..

1)R=make vector3(1)
Where R is my 3 components vector

2)Set vector3 1, x#, y#, z#
Where x#,y# and z# are the object angle x(), object angle y() and object angle z().

3)RotMatrix=dx mat(0)
mmm??... probably this is a command from ExtendRotation? what is the job of this command?

4)Dbobj get rotation matrix RotMatrix, object
mmmmmmmm... Maybe from this command I get my X, Y and Z converted angles?

My airplane is composed of several objects, some of which are scaled. But for angles I am referring to the attach wing object. A central cube, not scaled, which is located in the center of airplane back.
mr Handy
18
Years of Service
User Offline
Joined: 7th Sep 2007
Location: out of TGC
Posted: 4th Feb 2013 01:29 Edited at: 4th Feb 2013 01:42
So your object (plane) is rotated by (jedi) force, but it's pivot don't?

Well... you can do this trick: get some vertex positions, like from nose, tail, wings, middle center. When you [lock vertices] for object, you could get those known vertices' positions and do some simple math to get the angles.



*** Merry Chuckmas! ***
Alduce
23
Years of Service
User Offline
Joined: 26th Oct 2002
Location: Rama spaceship
Posted: 4th Feb 2013 09:09 Edited at: 4th Feb 2013 09:17
hey mr Handy you almost giving me some chances!!

Independently from aerodynamics of your airplane your method seems to be DAMN GOOD!

I suppose that to find angles from 2 vertexs is a matter outside the gimbal problematics!
but, HOW I can pick a choosed vertex of (for example) my airplane tail or a vertex of another specific airplane position?
And how I can get the angle between 2 choosed vertexs?

I see a lot of vertex commands in DBPro but sincerely I don't know from where I need to start to pick a specific vertex!


Quote: "So your object (plane) is rotated by (jedi) force, but it's pivot don't?"

Yeah, the airplane is rotated by external, dark!, forces.
About the pivot, yeah, more or less.

In fact If we consider my complete airplane (made by 18 objects) inside a physic world and inside an "athmosphere" where these physic and athmosphere make rotate this airplane then that airplane has a CG as pivot.
Here my english trying to kick hard my ass but I hope you can understand what I mean.

In fact when I rotate the ailerons so I can see my airplane start to rotate (thx to the air particles friction) in a specific "pivot point";
yes, probably this is what, in this specific case, you call "pivot". But sure is not the classic pivot known in the DarkBasic world.


Hey, more seconds flowing while I writing this post, more chanches I think I have to overtake my problem!
Please give me a little example to understand how I can pick a specific vertex!
mr Handy
18
Years of Service
User Offline
Joined: 7th Sep 2007
Location: out of TGC
Posted: 4th Feb 2013 09:31 Edited at: 4th Feb 2013 09:35
Pseudo code for picking nose vertex:



now we know the farthest chosen vertex position for nose.
then we get all other vertices.
then we just calculate the center between all chosen vertices (nose,tail,wing R, wing L, etc...)

to get angle: Return Float=ATANFULL(Distance X (chosenx-centerx), Distance Y(choseny-centery))

now setup is complete, we know default angles when plane is standing still. so we don't need correct 90* angles, we just need to know the difference between default and current!

*** Merry Chuckmas! ***
Alduce
23
Years of Service
User Offline
Joined: 26th Oct 2002
Location: Rama spaceship
Posted: 4th Feb 2013 10:19
okok.. please take a look of this code:



I am in the right direction? With this code I suppose I got x_final, y_final and z_final.
These 3 points are the X,Y and Z 3D position of a vertex of the airplane nose object.

mmm, over the fact that probably this code is not correct, how can I choose a PRECISE vertex x,y,z 3D point?
Can I know exactly what is the vertex I am choosing?
Please take a look of my attached pic.
mr Handy
18
Years of Service
User Offline
Joined: 7th Sep 2007
Location: out of TGC
Posted: 4th Feb 2013 10:34 Edited at: 4th Feb 2013 10:44
Here. You need to get INDEX of the vertex, by comparing only the value of desired axis. For example, you will be comparing the lowest Y to get most bottom vertex of the plain.





You get precise positions. To see current vertex just make a sphere and move it to the current vertex pos, then point camera at it!

*** Merry Chuckmas! ***
Alduce
23
Years of Service
User Offline
Joined: 26th Oct 2002
Location: Rama spaceship
Posted: 4th Feb 2013 10:59 Edited at: 4th Feb 2013 11:00
ammm maybe I start to get the point!

Really interesting this matter.

Watch my version of your "unhappy plane" picture.

I obtain all the X vertexs of the airplane nose object.

So at this point, I know the vertexs lenght of my airplane nose object and knowing that I can obtain the first X vertex and the last X vertex of the nose shape.
Then, picking the first X vertex I am choosing the apix of the airplane nose object...

It's that correct???

Ps. really thankyou for vertex lesson!

mr Handy
18
Years of Service
User Offline
Joined: 7th Sep 2007
Location: out of TGC
Posted: 4th Feb 2013 11:10 Edited at: 4th Feb 2013 11:10
Yes. You could make an automatic vertex function or make an editor, where you can mark different vertices manually for different purposes, like exact distances between moving parts of the plane or else.

Or as you using physics, you could realtime paint vertices with colors to show tension, pressure or else.

*** Merry Chuckmas! ***
Alduce
23
Years of Service
User Offline
Joined: 26th Oct 2002
Location: Rama spaceship
Posted: 4th Feb 2013 11:20
mr Handy THANK YOU!

I think now it's time to make some test about!

I will inform you about results. I hope I got right vertex knowledge to start to do something good.

About to get angle between 2 vertexs emm... I think I will ask again your help but for now is testing time!
mr Handy
18
Years of Service
User Offline
Joined: 7th Sep 2007
Location: out of TGC
Posted: 4th Feb 2013 11:27 Edited at: 4th Feb 2013 11:38
I think you need this:

DOT PRODUCT VECTOR3

x1 = x-centerx
y1 = y-centery
z1 = z-centerz

null=make vector 3(1)
null=make vector 3(2)
set vector 3, 1, x1, y1, z1
set vector 3, 2, 0, 1, 0 `this is UP axis vector, Y
normalize vector 1
value=DOT PRODUCT VECTOR3(1,2)

value is float from -1 to 1 (AFAIR)

value 1 = vectors are same, i.e. angle is 0
value 0 = vectors are perpendicular, i.e. angle 90*
value -1 = angle 180

*** Merry Chuckmas! ***
Alduce
23
Years of Service
User Offline
Joined: 26th Oct 2002
Location: Rama spaceship
Posted: 4th Feb 2013 11:48
Quote: "I think you need this:

DOT PRODUCT VECTOR3

x1 = x-centerx
y1 = y-centery
z1 = z-centerz

null=make vector 3(1)
null=make vector 3(2)
set vector 3, 1, x1, y1, z1
set vector 3, 2, 0, 1, 0 `this is UP axis vector, Y
normalize vector 1
value=DOT PRODUCT VECTOR3(1,2)

value is float from -1 to 1 (AFAIR)

value 1 = vectors are same, i.e. angle is 0
value 0 = vectors are perpendicular, i.e. angle 90*
value -1 = angle 180"


I suppose this code is to obtain an angle between 2 vertexs...
and since a vertex is a point made by three 3D points so I need to enclose these three 3D points then this vertex inside a vector!...

so I will find the angle between 2 vectors????...............
haha my poor brain...

mmm:


what is x?
what is centerx?
and WHAT IS X1???
I need to avoid doubts about that 'cause I am near to fall in the nothing!!!
MadBit
VIP Member
Gold Codemaster
17
Years of Service
User Offline
Joined: 25th Jun 2009
Location: Germany
Posted: 4th Feb 2013 12:08
Or you use (eXtendet rotation):

v1 = DXVEC3 (0, x1, y1, z1)
v2 = DXVEC3 (0, 0, 1, 0)
DXVEC3 NORMALIZE v1, v1

value = DXVEC3 DOT (v1, v2)

BTW:
with XROT MATRIX TO EULER you can get the Euler angles from any matrix you have.

Share your knowledge. It's a way to achieve immortality. (Tenzin Gyatso)
Pixie-Particle-Engine
Le Verdier
14
Years of Service
User Offline
Joined: 10th Jan 2012
Location: In the mosh-pit
Posted: 4th Feb 2013 12:10
About the "vertices method", I can assure you that it's all the same than working with matrix... in more complicated with issues...

1) get vertex position() give the local coord of the vertex, but to convert it in global coord we need object transform matrix...

2) A vertex index compatible with axis to find is required.. Need some extra calculations...

3) normalized(vertex-center)... It is exactly the result provided by rotation matrix... Without doing other calculation... Just grab the vector!

It is exactly what my previous code does.
!!the nose is pointing along the Z axis (not X like the draw)

mr Handy
18
Years of Service
User Offline
Joined: 7th Sep 2007
Location: out of TGC
Posted: 4th Feb 2013 12:12 Edited at: 4th Feb 2013 12:14
DOT PRODUCT VECTOR3
Command returns angle between two vectors as [-1;1] range.
"x" is, for example, x value of nose chosen vertex.
"centerx" is x value of the plain center.
"x-centerx" returns vector value for x, i.e. vector pointed from center to chosen vertex.
"normalize" scales vector up or down to fit exactly in [-1;1] range.

so your vector from center to your chosen vertex is like this:
normalise(vector3(x-centerx,y-centery,z-centerz))

axis itself is a vector too.
up vector (axis Y) is 0,1,0
right vector (axis Z) is 0,0,1

and "dot" finds the angle!

how to convert result:
result=((1-result)*0.5+0.5)*180

*** Merry Chuckmas! ***
MadBit
VIP Member
Gold Codemaster
17
Years of Service
User Offline
Joined: 25th Jun 2009
Location: Germany
Posted: 4th Feb 2013 12:15 Edited at: 4th Feb 2013 12:16
or easy: angle = XROT GET AXIS ANGLE BETWEEN VECTORS(result_axis, vector1, vector2)

Share your knowledge. It's a way to achieve immortality. (Tenzin Gyatso)
Pixie-Particle-Engine
mr Handy
18
Years of Service
User Offline
Joined: 7th Sep 2007
Location: out of TGC
Posted: 4th Feb 2013 12:21
Quote: "or easy"

no plugins, only hardcore!!!

*** Merry Chuckmas! ***
Le Verdier
14
Years of Service
User Offline
Joined: 10th Jan 2012
Location: In the mosh-pit
Posted: 4th Feb 2013 12:25 Edited at: 4th Feb 2013 12:26
Quote: "
DOT PRODUCT VECTOR3
Command returns angle between two vectors as [-1;1] range.
"


It returns the Cosinus of angle (when the input vectors are normalized)
But very often, this value can be used directly

Alduce
23
Years of Service
User Offline
Joined: 26th Oct 2002
Location: Rama spaceship
Posted: 4th Feb 2013 12:35 Edited at: 4th Feb 2013 12:40
Dudes, I am a bit sad because all your methods are really hard to understand for me.
My math and brain limits are reached.
I trying to understand your codes and your logic too but I have not the base of knowledge about vectors, matrixs and math to transform your words in a my own code.

I don't want to bother you and from what I understand no one of you all is using DarkDynamix so I can't give you my code.
(If someone of you is using DarkDynamix I provide my code in 1 millisecond!)


So start with the following:

AIRPLANE NOSE = obj n°1
AIRPLANE BODY = obj n°2
AIRPLANE LEFT WING = obj n°3
AIRPLANE RIGHT WING = obj n°4
AIRPLANE TAIL = obj n°5

All of these airplane parts has XYZ position and ROTATION and all of these airplane parts has own vertexs.

PLEASE, I know is bad to tell you that but can you write for me a code to obtain ROLL ANGLE?.
You can use vector, matrix, vertexs or what you want but since now I can't go ahead with just my legs I need some code to fit in my code


PS:
Quote: "or easy: angle = XROT GET AXIS ANGLE BETWEEN VECTORS(result_axis, vector1, vector2)"

emm but a XROT GET AXIS ANGLE BETWEEN 2 VERTEX not eh.. ..I am totally out of ammo dudes...
Le Verdier
14
Years of Service
User Offline
Joined: 10th Jan 2012
Location: In the mosh-pit
Posted: 4th Feb 2013 12:57
My last code dont work as you want???

....
DBOBJ GET ROTATION MATRIX RotMatrix, 2: rem plane body object

GetYawPitchRollFromDXMat(1, RotMatrix)
Yaw#=x vector3(1)
Pitch#= y vector3(1)
Roll#= z vector3(1)

...

Alduce
23
Years of Service
User Offline
Joined: 26th Oct 2002
Location: Rama spaceship
Posted: 4th Feb 2013 14:10 Edited at: 4th Feb 2013 14:15
Quote: "My last code dont work as you want???

....
DBOBJ GET ROTATION MATRIX RotMatrix, 2: rem plane body object

GetYawPitchRollFromDXMat(1, RotMatrix)
Yaw#=x vector3(1)
Pitch#= y vector3(1)
Roll#= z vector3(1)

...
"


Hi Le Verdier, I previously check your code and I thought it did not work because :

1) I run your example
2) I make roll the ship since ROLL = -20
3) Now I apply a YAW = -43

After I applied the YAW rotation I take a look of my ROLL value.
This value must be -20 (as my last ROLL move) but NOT! After the YAW rotation I see my ROLL = -13 ..

This is exactly the problem I think I have since now. (But sure that using your example is avoided the problematic about the Y value that when touch 90 degrees so the Z value changing drastically. So, sure a problem less)

Maybe this ROLL change when I aplly YAW rotation is caused from the DBPro commands you are using to move the ship?
Maybe your YAW effect affect the ROLL value?
Maybe is that perfectly normal and right???

In my (probably) limited view of angles matter, I think that my ROLL value must not change when I apply YAW rotation!. I am wrong at that?
mr Handy
18
Years of Service
User Offline
Joined: 7th Sep 2007
Location: out of TGC
Posted: 4th Feb 2013 15:02
Well, If you CAN use roll, yaw... I am totally lost at what you are doing...

*** Merry Chuckmas! ***
Le Verdier
14
Years of Service
User Offline
Joined: 10th Jan 2012
Location: In the mosh-pit
Posted: 4th Feb 2013 15:21
Yes, it's perfectly normal and right.
Because in this demo code, the left ship is NOT controlled using Yaw Pitch Roll, but standard dbp order.
This just to show the effect of the conversion!

MadBit
VIP Member
Gold Codemaster
17
Years of Service
User Offline
Joined: 25th Jun 2009
Location: Germany
Posted: 4th Feb 2013 15:44
@Alduce:
Try this code to get the roll value:

code snippet:


Share your knowledge. It's a way to achieve immortality. (Tenzin Gyatso)
Pixie-Particle-Engine
Alduce
23
Years of Service
User Offline
Joined: 26th Oct 2002
Location: Rama spaceship
Posted: 4th Feb 2013 16:23
Guys, your tries to help me is really cool thank you all, really.

Now I start to do some serious tests and experiments using all your posts in this thread.

I understand I can't explain me too good and I think that you've probably already found my solution.

So now I must to experiment. By tomorrow I will update you on the situation
Alduce
23
Years of Service
User Offline
Joined: 26th Oct 2002
Location: Rama spaceship
Posted: 4th Feb 2013 18:05
EDIT (I hope it's not just a dream with open eyes..):

@MadBit : Your code WORKS GREAT! little and great in just one thing! as a little precious gold item! I love it!

@Le Verdier : haha dude, your code WORKS GREAT too!!.. I was really on wrong when I was thinking about it was not working..
These are the bad jokes my brain making me from the moment I start to try to learn 3D math......... THX for all!!!

@mr Handy : Thanx to you I start to understand the vertex matter! And is a really interesting matter cause let us to do a lot of complex things. I am already thinking about some code to make my airplane sheet damaged,bent and sketched using vertexs!

Again A THANK YOU BIG AS JUPITER TO ALL YOU GUYS!
Alduce
23
Years of Service
User Offline
Joined: 26th Oct 2002
Location: Rama spaceship
Posted: 5th Feb 2013 11:06 Edited at: 5th Feb 2013 11:08
EDIT:

Hi all dudes!
I can tell the Gimbal Lock problem is solved!.

Yesterday I made a lot of test and experiments using Le Verdier and MadBit codes.

Here a little visual report about the ROLL and PITCH using these codes.
My final goal is to get a 360 angle or a +179/-179 angle.
In short, something that will make the angle ALWAYS unique.

Please watch the attached pic:



You can notice Le Verdier and MadBit PITCH values are both NOT UNIQUE as you can notice from the attached pic.

You can notice also Le Verdier ROLL value is ALWAYS unique (I got a problem putting the MadBit ROLL in the pic but IS NOT UNIQUE as the MadBit PITCH)

So the ROLL problem is TOTALLY SOLVED about gimbal lock problems and about to have always an unique value.

Then the last problem is the PITCH value that since now is solved about Gimbal lock problematics but not solved about unique value.

I tried to change and modify the math of both methods (using wrapvalue command too) but believe me, funny things have happened
MadBit
VIP Member
Gold Codemaster
17
Years of Service
User Offline
Joined: 25th Jun 2009
Location: Germany
Posted: 5th Feb 2013 11:27 Edited at: 5th Feb 2013 11:28
I don't know how you get the pitch angle with my code. Can't use the same code from getRoll for the pitch angle. Here is the code for the pitch angle.



Share your knowledge. It's a way to achieve immortality. (Tenzin Gyatso)
Pixie-Particle-Engine
Le Verdier
14
Years of Service
User Offline
Joined: 10th Jan 2012
Location: In the mosh-pit
Posted: 5th Feb 2013 11:41 Edited at: 5th Feb 2013 12:10
I'm not sure I've understood about unique values..
But you have to see that Euler angles is a simplified method to represent object orientation. Method which have drawbacks..
One of these is for a given orientation' there is several solutions
Let me take a example:
Imagine flying in your plane to NorthWest
Your yaw is -45, all is good..
Now imagine flying SouthEast... On the back!
Your yaw is still -45 but pitch is 180!
This is confusing because it's natural to see yaw as the direction we are going...(relative to a fixed ground)
To fix this we set yaw to 135, and roll to 180..
(You can notice sudden changes of P R in my code, this to adapt to Yaw=direction...(And for the pitch, to fix divide/0 and numerical robustness issues...))
An angle alone is only a part of the problem...

Alduce
23
Years of Service
User Offline
Joined: 26th Oct 2002
Location: Rama spaceship
Posted: 5th Feb 2013 12:38 Edited at: 5th Feb 2013 12:45
@ MadBit:

Here what I am using:

PITCH


ROLL



You can notice that the roll is different from your posted code:
ROLL MadBit original:



1) I had to change your DXVEC3(0, 0, 0, 1) in DXVEC3(0, 1, 0, 0) because just
in this way I obtain the ROLL in my
game XYZ configuration...
I don't know why.. I just know that I know really little
about all that...

2) As you can see I am already using your pitch configuration!

------------------------------------------------------------------

@Le Verdier:
Please watch the new attached pic, you can see what
I mean for UNIQUE value. In all rotation frames
you can see that the value is always different from
other rotation frames!
How I can be sure of the airplane REAL PITCH if the pitch value 35 is the same for 2 pitch frames?

however, in spite of many difficulties by to understand
all the logic about angles and rotation, I think
I understand what you mean... or I hope that.. haha

MadBit
VIP Member
Gold Codemaster
17
Years of Service
User Offline
Joined: 25th Jun 2009
Location: Germany
Posted: 5th Feb 2013 13:02
why do not store your roll and pitch values ​​in separate variable/vectors? It's much faster and easier to handle.

Share your knowledge. It's a way to achieve immortality. (Tenzin Gyatso)
Pixie-Particle-Engine
Le Verdier
14
Years of Service
User Offline
Joined: 10th Jan 2012
Location: In the mosh-pit
Posted: 5th Feb 2013 13:04
It is exactly what I mean...
If you want an unique value of Pitch, you will have several values of Yaw and Roll..
Idem for Yaw > P/R
Idem for Roll Y/P
You can't have an unique value for each one.
Just define a priority.

Alduce
23
Years of Service
User Offline
Joined: 26th Oct 2002
Location: Rama spaceship
Posted: 5th Feb 2013 17:02
Quote: "why do not store your roll and pitch values ​​in separate variable/vectors? It's much faster and easier to handle."


mmmm I was thinking I am already using separate vectors...
PITCH:
up = DXVEC3(0)
g_up = DXVEC3(0, 0, 0, 1)

ROLL:
Roll_up = DXVEC3(0)
Roll_g_up = DXVEC3(0, 1, 0, 0)

Quote: "It is exactly what I mean...
If you want an unique value of Pitch, you will have several values of Yaw and Roll..
Idem for Yaw > P/R
Idem for Roll Y/P
You can't have an unique value for each one.
Just define a priority."


ah, interesting.. So in your previous code you choosed ROLL as priority.
If I would to have pitch as priority? where I have to change your code?
Le Verdier
14
Years of Service
User Offline
Joined: 10th Jan 2012
Location: In the mosh-pit
Posted: 5th Feb 2013 21:19
Quote: "If I would to have pitch as priority? where I have to change your code?"

I know for yaw, for roll, but for pitch I dont know...
I have never actually needed that..
About the pitch angle,it is negative when the nose is up, and positive when down.
(Not like in your table)

Alduce
23
Years of Service
User Offline
Joined: 26th Oct 2002
Location: Rama spaceship
Posted: 6th Feb 2013 09:45 Edited at: 6th Feb 2013 09:46
@Le Verdier:

Quote: "I know for yaw, for roll, but for pitch I dont know...
I have never actually needed that.."

No problem mate, believe me, you've already done so much!


Quote: "About the pitch angle,it is negative when the nose is up, and positive when down.
(Not like in your table)"

mmmmmmm this is strange since I have not made ​​any changes to your code but probably something happen when I fit your code in my code.

Login to post a reply

Server time is: 2026-07-07 02:39:01
Your offset time is: 2026-07-07 02:39:01