Rotation matrix ortho-normalization

Started by
39 comments, last by minorlogic 19 years, 5 months ago
Quote:Original post by Airo
I've got a question about Dimitry's matrix orthonormalizing method.

This way the same columns are used. Is it a good idea to switch the order for which columns are processed for the orthonormalization during the simulation?

first with the order dimitry gave and next orthonormalisation
for example start with Column3=Normalized(CrossProduct(Column1,Column2)) and do other 2 columns

or is this just making things more complicated?

It shouldn't matter -
Column1=Normalized(CrossProduct(Column2,Column3));
Column2=Normalized(CrossProduct(Column3,Column1));
needs to be normalized anyway.
Maybe my version is marginally more mathematically stable, but i can't say for sure.

It may be useful to swich order depending to what axis more needs to be keept mostly untouched.
It's may be better in some cases to keep specific row.
(it will work with rows instead of columsn as well). For instance, if matrix contains global->local transform for camera, iin opengl style, it's better to keep 3rd row.
Advertisement
interesting picture.

what is it? a vonoroi representation of the vertices of a subdivided isocahedron?
Quote:Original post by Eelco
interesting picture.

what is it? a vonoroi representation of the vertices of a subdivided isocahedron?

Yes,kinda like that.
Some more things
I'm using some kind of projection matrices to get coordinates on icosohedron faces - i just multiply coordinate with 3x3 matrix and then divide result by result's z, and i'm getting point projected onto icosohedron face.
sounds very interesting for planet rendering.
You two are hopeless.

Quote:
“1:Eelco gave keyword for search, therefore, he answered original question. I just failed to remember that it's named after Gramm-Schmidt, so i posted a solution.”

I am glad he is learning that method I was the want who introduced to him after hi gave another erroneous answer to similar question in another tread. But I think he still needs to understand the meaning of it and not applying it literally.
And not he did not answer the question he just say quaternion are better than matrices.
And that is not truth. Maybe for him they are.

Quote:
“2:It's not needed to rewrite everything, because quaternions and rotation-only matrices represent same thing. They both is concatenated by multiplication, both should have functions like "load to openGL", most methods of both is the same. With good design, it's not a problem to replace one by other. Also, it's probably better if OP will rewrite it now than later, because probably the only thing he need to rewrite now is camera class.”

You are totally wrong man quaternion do not concatenate by multiplication, I just proved to you, just do it yourself, before making such statements, and yes replacing the transformation in a major re-factoring job that may bring a whole new bag of bugs. It may not even be possible, as I read the person is using directx.

Quote:
“3:I don't think no one else understands rotations better than i. Yes, i sometimes have altitude like "f34r my math skillz", but it's usually when i'm first to reply with some simple calculations done in mind.”

Wow that is a strong statement, the only think I can say is that it speaks for itself.
Oh maybe you should do more things on paper and less work in your mind, you could get better result, and less misleading would result of such impulsive reactions.

Quote:
“In summary: If you need to store and process variable rotation, quaternions is better than matrices”

perhaps you should rephrase it like this:

If you need to store and process variable rotation, in my opinion quaternions is better than matrices”

As for Eelco: I think there is not point to continue this argument: Eelco I think you should use quaternion in your projects and do not let anyone else to convince you otherwise.

Bye.
Quote:Original post by Anonymous Poster
You two are hopeless.

Quote:
“1:Eelco gave keyword for search, therefore, he answered original question. I just failed to remember that it's named after Gramm-Schmidt, so i posted a solution.”

I am glad he is learning that method I was the want who introduced to him after hi gave another erroneous answer to similar question in another tread. But I think he still needs to understand the meaning of it and not applying it literally.
And not he did not answer the question he just say quaternion are better than matrices.
And that is not truth. Maybe for him they are.

ah that explains a lot. i thought i recognized that debating style, or rather lack of it, from somewhere.

Quote:
Quote:
“2:It's not needed to rewrite everything, because quaternions and rotation-only matrices represent same thing. They both is concatenated by multiplication, both should have functions like "load to openGL", most methods of both is the same. With good design, it's not a problem to replace one by other. Also, it's probably better if OP will rewrite it now than later, because probably the only thing he need to rewrite now is camera class.”

You are totally wrong man quaternion do not concatenate by multiplication, I just proved to you, just do it yourself, before making such statements, and yes replacing the transformation in a major re-factoring job that may bring a whole new bag of bugs. It may not even be possible, as I read the person is using directx.

why are directx and quaternions mutually exclusive? i dont know directx, so it might be for all i know, but it somehow seems very unlikely to me.

Quote:
Quote:
“3:I don't think no one else understands rotations better than i. Yes, i sometimes have altitude like "f34r my math skillz", but it's usually when i'm first to reply with some simple calculations done in mind.”

Wow that is a strong statement, the only think I can say is that it speaks for itself.
Oh maybe you should do more things on paper and less work in your mind, you could get better result, and less misleading would result of such impulsive reactions.

Quote:
“In summary: If you need to store and process variable rotation, quaternions is better than matrices”

perhaps you should rephrase it like this:

If you need to store and process variable rotation, in my opinion quaternions is better than matrices”

As for Eelco: I think there is not point to continue this argument: Eelco I think you should use quaternion in your projects and do not let anyone else to convince you otherwise.

Bye.

on the contrary. maybe this debate is pointless, and i fear it is, but if you would present some arguments as to why quaternions are not superior to matrices for the stated purposes, i would gladly consider them. unfortunatly, your ratio bewteen logical arguments and flames seems to be lowering by the post...
AP don't you have an account. It's not so pleasant to speak with the invisible man.

Quote:Original post by Anonymous Poster
Rotation of a vector by a quaternion while it is possible it is about 8 time more expensive than rotation by the matrix equivalent.

False, it's of the same order of magnitude. I benchmark math functions all day long for my math lib. I remember a thread where I compared Q*V against M<-Q then M*V. The balance point was around 6 vertices. So you can easilly infer from these data, that Q*V is roughly 100%-50% slower than M*V. This depends on wether you use the FPU, 3DNow or SSE. Thus if you have less than 6 vertices. Quat*Vert is fine. Else with more verts the Quat to Matrix transfo, will be marginal.

Quote:
If you do not belief me then you look and two mayor graphics apis OpenGL and direct3d they use matrices to form matrix stack, not quaternion.

You missed the point. It's first principally because matrices are not isomorph to quaternions. Matrices enable projections, non uniform scaling etc ... It's only for this reason : generality of the matrices that any RENDERER uses them in their API. It's also because the RENDERER obviously prefers to deal with matrices, the fastest way to transform many vertices, as you said it's the fastest general way.

BUT :

Obviously accumulation of rotations between frames concerns ANIMATION which is obviously of the user responsibility and the IN TOPIC for this thread. Quaternions are more accurate, because made of 4 floats. Implicitely a rotation and a uniform scaling. Exactly what's required, not less not more. That's for this precise reason that you could intuitively understand why it's far less sensible to numeric deviations than general matrices. Now if you want a true math proof Dmytry or I can surely deliver that. Still I have other cats to beat. But you could also possibly Google by yourself. That'd be fair. I also remember my first year in "Mathematiques Superieures", the teacher warned us very clearly that matrices are highly unstable numerically. So you could also ask to your local math teacher if you know one.

OpenGL and D3D do not cope with such accumulations. Well you could use the matrix stack this way but be prepared to see your scene shrink and post a noob question like : "Why does my scene disappear ?"
"Coding math tricks in asm is more fun than Java"
Just a note.
In algorithm that i posted before, not used SQRT routine.

When you do cross and normalization , you use SQRT or invSQRT.
Quote:Original post by Anonymous Poster
You two are hopeless.

Quote:
“1:Eelco gave keyword for search, therefore, he answered original question. I just failed to remember that it's named after Gramm-Schmidt, so i posted a solution.”


I am glad he is learning that method I was the want who introduced to him after hi gave another erroneous answer to similar question in another tread.

Do you realize that it's not a valid argument?
Quote:

But I think he still needs to understand the meaning of it and not applying it literally.
And not he did not answer the question he just say quaternion are better than matrices.
And that is not truth. Maybe for him they are.

Quote:
“2:It's not needed to rewrite everything, because quaternions and rotation-only matrices represent same thing. They both is concatenated by multiplication, both should have functions like "load to openGL", most methods of both is the same. With good design, it's not a problem to replace one by other. Also, it's probably better if OP will rewrite it now than later, because probably the only thing he need to rewrite now is camera class.”

You are totally wrong man quaternion do not concatenate by multiplication, I just proved to you, just do it yourself, before making such statements,

Where you proved? Proved what?

Read the <href="http://www.flipcode.com/documents/matrfaq.html">FAQ
or gamedev version

and mathworld, look at end of page.

Quaternion rotations is concatenated by quaternion multiplication.
Quote:
and yes replacing the transformation in a major re-factoring job that may bring a whole new bag of bugs. It may not even be possible, as I read the person is using directx.

First time hear that quaternions is inpossible in directx.... interesting.
Quote:
Quote:
“3:I don't think no one else understands rotations better than i. Yes, i sometimes have altitude like "f34r my math skillz", but it's usually when i'm first to reply with some simple calculations done in mind.”

Wow that is a strong statement, the only think I can say is that it speaks for itself.
Oh maybe you should do more things on paper and less work in your mind, you could get better result, and less misleading would result of such impulsive reactions.

Maybe i have incorrectly computed angles and axises of your example quaternions?
Please catch at least one formal mistake i made in calculations before suggesting me what to do in paper.
Quote:

Quote:
“In summary: If you need to store and process variable rotation, quaternions is better than matrices”

perhaps you should rephrase it like this:

If you need to store and process variable rotation, in my opinion quaternions is better than matrices”

As for Eelco: I think there is not point to continue this argument: Eelco I think you should use quaternion in your projects and do not let anyone else to convince you otherwise.

Bye.

Bye.

[edit: quote tags fixed]

[Edited by - Dmytry on October 26, 2004 1:56:12 PM]
Quote:Original post by minorlogic
Just a note.
In algorithm that i posted before, not used SQRT routine.

When you do cross and normalization , you use SQRT or invSQRT.

Ya gde-to pro eto chital dage, vozmozhno tvoi tekst. Eto ti pridumal pervii? (moy quaternion-to-matrix prosto delaet mashtabiruuschuu matricu esli quaternion ne edinichnoi dlini). Mozhno novuu temu zapostit' , a-to tut opyat' anonimi vodu mutyat (delo konchitsya tem chto voobche zapretyat anonimov nafig). Eto osnovanno na idee chto esli podelit matricu na dlinu v kvadrate, poluchim pravilnuu matricu?

Yes, i readed about it somewhere. Maybe it was your text. It's interesting. It uses idea that if we scale resulting matrix by 1/squared_quaternion_length, we get matrix without scaling?

2everyone logged in: what you think about this quaternion from matrix and quaternion to matrix formules? Is it's known?

This topic is closed to new replies.

Advertisement