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.
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
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!
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.
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
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…)
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.
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.
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.
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…)
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!