• Announcements

    • khawk

      Download the Game Design and Indie Game Marketing Freebook   07/19/17

      GameDev.net and CRC Press have teamed up to bring a free ebook of content curated from top titles published by CRC Press. The freebook, Practices of Game Design & Indie Game Marketing, includes chapters from The Art of Game Design: A Book of Lenses, A Practical Guide to Indie Game Marketing, and An Architectural Approach to Level Design. The GameDev.net FreeBook is relevant to game designers, developers, and those interested in learning more about the challenges in game development. We know game development can be a tough discipline and business, so we picked several chapters from CRC Press titles that we thought would be of interest to you, the GameDev.net audience, in your journey to design, develop, and market your next game. The free ebook is available through CRC Press by clicking here. The Curated Books The Art of Game Design: A Book of Lenses, Second Edition, by Jesse Schell Presents 100+ sets of questions, or different lenses, for viewing a game’s design, encompassing diverse fields such as psychology, architecture, music, film, software engineering, theme park design, mathematics, anthropology, and more. Written by one of the world's top game designers, this book describes the deepest and most fundamental principles of game design, demonstrating how tactics used in board, card, and athletic games also work in video games. It provides practical instruction on creating world-class games that will be played again and again. View it here. A Practical Guide to Indie Game Marketing, by Joel Dreskin Marketing is an essential but too frequently overlooked or minimized component of the release plan for indie games. A Practical Guide to Indie Game Marketing provides you with the tools needed to build visibility and sell your indie games. With special focus on those developers with small budgets and limited staff and resources, this book is packed with tangible recommendations and techniques that you can put to use immediately. As a seasoned professional of the indie game arena, author Joel Dreskin gives you insight into practical, real-world experiences of marketing numerous successful games and also provides stories of the failures. View it here. An Architectural Approach to Level Design This is one of the first books to integrate architectural and spatial design theory with the field of level design. The book presents architectural techniques and theories for level designers to use in their own work. It connects architecture and level design in different ways that address the practical elements of how designers construct space and the experiential elements of how and why humans interact with this space. Throughout the text, readers learn skills for spatial layout, evoking emotion through gamespaces, and creating better levels through architectural theory. View it here. Learn more and download the ebook by clicking here. Did you know? GameDev.net and CRC Press also recently teamed up to bring GDNet+ Members up to a 20% discount on all CRC Press books. Learn more about this and other benefits here.
Sign in to follow this  
Followers 0
gaimplay

Rotation matrix ortho-normalization

40 posts in this topic

Quote:
Original post by MichaelT
Quote:
Original post by Eelco
good luck using stawman tactics for everything.


explain: "stawman tactics"

i think he meant strawman arguments...

BTW, minorlogic: Privet, videl tvoi formuli kasatelno quaternionov na euclideanspace.com, kruto i vnushaet! (Hello, man! Readed your quaternion derivations on euclideanspace.com, pretty impressive!)
0

Share this post


Link to post
Share on other sites
Eelco as usual you misunderstood the question: This was the original question

“I'm trying to figure out how to orthonormalize a rotation matrix so that the basis vectors would be unit length and perpendicular. This is to combat floating point precision errors that accumulate in the matrix.”

For which Dmytry gave the correct answer.

I as understand this is the Game dev forum were people comes for answer to specific questions. You basically told Gaimplay that the answer to his question required a rewrite of the entire project for not reason at all. Has his done what you suggested in the end his still have the same problem his started with, would not he?
I just reconfirmed the first answer was the correct one for the question.
What you did was to create and answer in search of a new problem. Part of been smart is not just to accumulate knowledge you also need to understand then questions.
Has it occur to you hi may be working on a very serious project where engineering re-factoring is just not an option.

About the straw man argument: like I said as usual you missing the point again and changing the subject.

Dmytry I think I am or was in you side this question was not about quaternions was about matrices. Make no mistake, do not think you are the only one understanding the algebra of rotation many more people do to.
0

Share this post


Link to post
Share on other sites
Quote:
Original post by Anonymous Poster
Eelco as usual you misunderstood the question: This was the original question

“I'm trying to figure out how to orthonormalize a rotation matrix so that the basis vectors would be unit length and perpendicular. This is to combat floating point precision errors that accumulate in the matrix.”

For which Dmytry gave the correct answer.

I as understand this is the Game dev forum were people comes for answer to specific questions. You basically told Gaimplay that the answer to his question required a rewrite of the entire project for not reason at all. Has his done what you suggested in the end his still have the same problem his started with, would not he?
I just reconfirmed the first answer was the correct one for the question.
What you did was to create and answer in search of a new problem. Part of been smart is not just to accumulate knowledge you also need to understand then questions.
Has it occur to you hi may be working on a very serious project where engineering re-factoring is just not an option.

i wasnt the one to bring up quaternions, i started out with giving him a possible solution to his stated problem. i merely confirmed what charles and dymtry suggested: quaternions might serve you better, so you might want to consider them. to which i added: probably, if you dont care for the advantages matrices have to offer over quats, which is likely in a gameengine.

Quote:

About the straw man argument: like I said as usual you missing the point again and changing the subject.

believe whatever you wish. youll have to start making arguments though if youre interested in persuading others.

Quote:

Dmytry I think I am or was in you side this question was not about quaternions was about matrices. Make no mistake, do not think you are the only one understanding the algebra of rotation many more people do to.

sure many people understand this, and my understanding probably isnt nearly as deep as that of a lot of others. i doubt those people include you though. i might add to that that dmytry and charlesB are the most knowledgeable people i know on these boards on the subject of math, and they seem to hold the same stance, which i will reiterate again for clarity: quaternions are the best method to store pure rotation (+ uniform scaling optionally).

were not forcing him to rewrite his engine using quats, we answered his question, dmytry corrected me and gave an even better method, and we gave some suggestions beyond the scope of his question: which he is free to act on or completely ignore.
0

Share this post


Link to post
Share on other sites
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?
0

Share this post


Link to post
Share on other sites
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.

After question is answered, it's OK to discuss related topics that can be useful for OP.

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.

3:I don't think no one else there 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.

4: you gave no mathematical proofs, only some example quaternions that "should do bad things". In fact they don't, and it's pretty easy to mentally figure what 'em do if you know quaternions.

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


f34r skillz part: today and at yesterday evening i worked with matrices for perspective transforms used to do that clickster (matrices that was used to make that hexagons, not camera matrices)

edit: and i must say, i clicked "reply" before i saw Eelco's reply.

[Edited by - Dmytry on October 26, 2004 9:26:21 AM]
0

Share this post


Link to post
Share on other sites
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.
0

Share this post


Link to post
Share on other sites
interesting picture.

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

Share this post


Link to post
Share on other sites
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.
0

Share this post


Link to post
Share on other sites
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.
0

Share this post


Link to post
Share on other sites
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...
0

Share this post


Link to post
Share on other sites
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 ?"
0

Share this post


Link to post
Share on other sites
Just a note.
In algorithm that i posted before, not used SQRT routine.

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

Share this post


Link to post
Share on other sites
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]
0

Share this post


Link to post
Share on other sites
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?
0

Share this post


Link to post
Share on other sites
Hi Dmytry.

quat 2 matrix formula -> is derived from Quaternion properties.
we just use nonunit quat to derive it.

matrix 2 qut is good known too, but produce nonunit quat and it is VERY efficient, such one i did not see anywhere.
0

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0