Page 1 of 2 12 LastLast
Results 1 to 20 of 38

Thread: Tutorial: Orientation Matrix [Rotation about *any* point added]

  1. #1

    Tutorial: Orientation Matrix [Rotation about *any* point added]

    I have written a short tutorial (rotation.zip 264K ) describing the Orientation matrix (the matrix you get when calling getOrientation() on a game object), and how to use it for some rotation problems (eg. flipping an object upright, or pointing one object in another's direction).

    Be warned though, the tutorial is fairly mathematical, and the reader is assumed to be familiar with basic concepts of vectors and matrices.

    I'd appreciate comments and suggestions.
    Last edited by herman.tulleken; 08-Aug-07 at 09:02.



  2. #2
    Comments and suggestions?!
    Sure, If I only understood a word?!
    But the final ( 5.5, 5.6) it's just beautiful
    Like an abstract poem or a modern drawing
    Most of us, blender users, and that's why we use it, are programming
    illiterates
    Can you make some examples in action?
    It would be great
    Thank you anyway
    Bye



  3. #3
    Hey, thanks a lot. That will make a great reference. I hate hunting that kind of thing up when I have to do something like that.



  4. #4
    I have added some Python code that implement the algorithms, and made some corrections.

    @OTO: Indeed, manipulating geometric objects is not for the feint of heart. I will try to add some blend files later this week. In the mean time the code I have added might be useful, even if it is somewhat less poetical than the math statements ;-)

    @fireside: Exactly what "inspired" this tutorial - hours of fruitless search and then hours of grinding tests!



  5. #5
    OK, here are three blend files (rotation.zip 264K) showing:
    • how to flip an object upright (but keeping its "front" in the same direction),
    • how to point one object's "front" to another, and
    • how to point one object's "front" to another and also keeping it upright.
    I discovered some better ways to solve these problems, and will update the written tutorial when I have time.
    Last edited by herman.tulleken; 21-Jun-06 at 10:26.



  6. #6
    Hello again
    Ah, now it's much more "funny"
    Thank you for the effort
    Maybe you can give me some tips
    I'm using Erwin's vehicle demo to make a demo for the contest
    But the car turns upside down often
    I can I avoid this, automatically ( inside the vehicle's script) or maybe
    with a key action?
    Bye



  7. #7
    Member blendenzo's Avatar
    Join Date
    Apr 2006
    Location
    Michigan, USA
    Posts
    2,702
    My heart is sinking. I was hoping to use a script to rotate my camera.... Oh, math! What do I look like here? An engineer? My father-in-law could read it better than I read English (I'm an ignorant American--I don't know any other languages), but to me and my high school diploma it's like walking through the arctic tundra naked: painful at first, until you go numb and turn blue. Then nothing really matters anymore.

    Thank you for your tutorial, though. As I have already gone numb, the pain is no longer a deterant. I am dedicated to figuring this out. (I'll just have to read it several more times, that's all...)
    "From somewhere, a transmission..."
    Game Engine tutorials: TutorialsForBlender3D - blendenzo.com - blending-online
    My Projects: Escape the Room - Brought2Life - UpRight - Solomon's Treasure - Sokoban - Marble Labyrinth



  8. #8
    Member blendenzo's Avatar
    Join Date
    Apr 2006
    Location
    Michigan, USA
    Posts
    2,702
    edit: Interesting... It posted twice for some reason...
    "From somewhere, a transmission..."
    Game Engine tutorials: TutorialsForBlender3D - blendenzo.com - blending-online
    My Projects: Escape the Room - Brought2Life - UpRight - Solomon's Treasure - Sokoban - Marble Labyrinth



  9. #9
    Member Social's Avatar
    Join Date
    Nov 2005
    Location
    New Jersey, USA
    Posts
    3,596
    It's just college level matrix math. I learned about some of this in highschool as well.

    I like that it's in PDF format, and I also like how you presented the code and the basic function setup.

    Useful stuff.
    It is in the nature of powerless people to vicariously enjoy the exercise of arbitrary power by others.

    - Dmitry Orlov



  10. #10
    @OTO

    You can use the script in "flip.blend" (in the zip above) to flip over your car (with a key action) [That is exactly how we flip over our car].

    Avoiding it, however, won't be easy using orientation, and I think it will take away from the natural dynamics. The best is to build a car which is more stable (size, weight, acceleration), or build a world that is less dangerous (slopes, ramps, height of bariers and general placement of obstacles). We spent *a lot* of time playing with settings, and built our world specifically for the car -- there is no quick fix.



  11. #11
    Member blendenzo's Avatar
    Join Date
    Apr 2006
    Location
    Michigan, USA
    Posts
    2,702
    Ah, Social, not everyone went to college. Yes, I remember learning these things in high school, but high school is fading quickly, and math seems to be going the fastest. I've used my education so rarely for years that (now that I have a use for it) it seems to resent me.

    Regardless, I did figure it out. Many thanks, herman.tulleken. Your tutorial showed me what I needed to know, and with a little help from forum search I was able to apply it. Additional thanks to fireside for sample code of what I needed, and also to wiseman303 for clarifying for me that the x, y, and z stuff is not in the rows of the matrix, but in the columns.
    "From somewhere, a transmission..."
    Game Engine tutorials: TutorialsForBlender3D - blendenzo.com - blending-online
    My Projects: Escape the Room - Brought2Life - UpRight - Solomon's Treasure - Sokoban - Marble Labyrinth



  12. #12
    Member Social's Avatar
    Join Date
    Nov 2005
    Location
    New Jersey, USA
    Posts
    3,596
    Originally Posted by blendenzo
    Ah, Social, not everyone went to college. Yes, I remember learning these things in high school, but high school is fading quickly, and math seems to be going the fastest. I've used my education so rarely for years that (now that I have a use for it) it seems to resent me.
    Point taken.

    I can definitely relate to the "fade" effect you are reffering to. Most of that stuff looked pretty useless until I actually needed it.

    If only teachers used the BGE to teach math. Imagine the possibilities.
    It is in the nature of powerless people to vicariously enjoy the exercise of arbitrary power by others.

    - Dmitry Orlov



  13. #13
    If only teachers used the BGE to teach math. Imagine the possibilities.
    Yeah. It's a joke in there, really. They spend so much time with proofs, and they pass over practical applications. Most of them are computer illiterate. I'm all for theory up to a point, but it's useless and uninteresting without practical applications. The teaching of math is stuck in the 1940's. They make this big deal that you buy a scientific calculator that costs about 1/3 the price of a decent computer and is borderline useless, then they don't let you use it on half the tests they give. I had a trig teacher that wasted so much time forcing everyone to memorize these tables and giving tests on it. Who remembers that crap when they get out? You look it up.
    Last edited by fireside; 21-Jun-06 at 06:30.



  14. #14
    New:
    • The PDF and blends are now neatly zipped together.
    • Formulas have been updated (with rows and columns as they should be - thanks for pointing that out).
    • A section and blend added that explains how to revolve one object around any point.
    This should be the final version - hope it is useful.



  15. #15
    Hello again
    Thank you very much for the tips!!
    I'll try them.
    Bye



  16. #16
    Member blendenzo's Avatar
    Join Date
    Apr 2006
    Location
    Michigan, USA
    Posts
    2,702
    I downloaded the new zip file, but ZippHO and WinRAR both say its corrupt. I was able to extract the blend files, but not the new pdf. (Strangely, I was looking forward to reading it...)
    "From somewhere, a transmission..."
    Game Engine tutorials: TutorialsForBlender3D - blendenzo.com - blending-online
    My Projects: Escape the Room - Brought2Life - UpRight - Solomon's Treasure - Sokoban - Marble Labyrinth



  17. #17
    I think its fixed now...



  18. #18
    Member Fred_Pyo's Avatar
    Join Date
    Mar 2002
    Location
    Asuncion, Paraguay
    Posts
    778
    My hat is off (and as you can see, it's a big one) for you herman.tulleken, thank you very much for putting this matrix stuff into a doc like this.

    You sure are a brave man .

    You even did it all in a nicely layed out PDF file, it looks pro .

    Note: on the rotate.blend file, the text data "text" is incomplete it just says "press space to see the".



  19. #19
    Member blendenzo's Avatar
    Join Date
    Apr 2006
    Location
    Michigan, USA
    Posts
    2,702

    Thanks!

    Thanks, Herman. The new zip archive works perfectly. Your "rotate an object around any point" script will certainly prove useful! I am imagining all of the cool things I can do with it... I must say, you've certainly offered a huge help to many of us who were previously very confused. Keep up the good work!
    "From somewhere, a transmission..."
    Game Engine tutorials: TutorialsForBlender3D - blendenzo.com - blending-online
    My Projects: Escape the Room - Brought2Life - UpRight - Solomon's Treasure - Sokoban - Marble Labyrinth



  20. #20
    Member scabootssca's Avatar
    Join Date
    Dec 2003
    Location
    wherever
    Posts
    2,047
    Thank you, very nice.
    Last edited by scabootssca; 06-Aug-08 at 00:33.



Page 1 of 2 12 LastLast

Similar Threads

  1. The Unofficial Texturing Tutorial
    By Landis in forum Works in Progress
    Replies: 30
    Last Post: 23-Jul-05, 21:51
  2. Problems with this head tutorial...
    By dgeneration in forum Basics & Interface
    Replies: 5
    Last Post: 14-Jun-04, 05:06
  3. Skills based tutorial sequence 2/4/04
    By u_do_u_r in forum Game Engine Support and Discussion
    Replies: 21
    Last Post: 01-Apr-04, 16:32
  4. Problems with the "castle" tutorial...
    By Gatonegro in forum Basics & Interface
    Replies: 5
    Last Post: 13-Feb-04, 09:09
  5. problem / solutionS
    By Landis in forum Basics & Interface
    Replies: 9
    Last Post: 04-Aug-03, 23:46

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •