Using getOrientation?

First of all, I know that many people have posted about this topic. I’ve already done a bunch of searching, and nothing really helped.

I need to know how to use the getOrientation command in the BGE.
Unfortunately, I am only a sophomore in high school (10th grade) and I have not learned trigonometry yet (although my dad gave me a quick overview).

I need to be able to know how to use getOrientation in a more practical sense… I just need to know how I can use it. (More specifically, I need to use it to find a camera’s orientation so that the movement of a ball is dependant on the camera’s view, not the global coordinates or the ball’s local coordinates.

All of the things I have found on Google were over my head (although I think I get the idea). :spin:

I would like someone (please!) to help me understand how I could use this. Just a few examples of scripts that use it, or something that can translate the 3x3 grid into rotation or something like that.

I’m using the game OzoneForce as a bit of an inspiration for what I’m doing. I’ve looked at all of its python files and I understand how it works, except the getOrientation command. I don’t want to copy it though, so if there’s a different way to find an object’s rotation, that’d be great.

I hope this doesn’t sound like too much to ask… but this could mean the difference between my first game and having to wait until college or whenever. This is essentially the only thing standing in my way. Please help!

There is an orientation tut in the GE resources.

You mean this? --> Tutorial: Orientation Matrix [Rotation about any point added]

Yeah, I read that earlier, and that did help me a little, but is there anybody who has a more “simplified” tutorial? (Or was that already simplified? haha) If not I suppose I could try to figure that one out with my dad…

Here is just a little tut:

http://www.tutorialsforblender3d.com/GameModule/ClassKX_GameObject.html

And this may be more helpful, I didnt finish reading it though:

http://www.blender.org/forum/viewtopic.php?t=4148&view=previous&sid=7e87d6a0b0c803bbe0efe13fadf5c98b

Here is a camera orientation script:

http://fguide.cn/gyfc/blenderartistsz3horgczvforumczvarchiveczvindexx9oczvt-70111z8hl.html

And here is a script to rot an object exactly:

http://translate.google.com/translate?hl=en&sl=es&u=http://www.canguro3d.com/public/modules/newbb/viewtopic.php%3Fforum%3D4%26post_id%3D99%26topic_id%3D29&sa=X&oi=translate&resnum=20&ct=result&prev=/search%3Fq%3DgetOrientation%2Bblender%26num%3D50%26hl%3Den%26lr%3D%26sa%3DG%26as_qdr%3Dall%26pwst%3D1

Here is orientation script for shadow, but it came from the ba here:
http://translate.google.com/translate?hl=en&sl=pt&u=http://www.blender.com.br/index.php%3Foption%3Dcom_fireboard%26Itemid%3D10%26func%3Dview%26id%3D3024%26catid%3D8&sa=X&oi=translate&resnum=23&ct=result&prev=/search%3Fq%3DgetOrientation%2Bblender%26num%3D50%26hl%3Den%26lr%3D%26sa%3DG%26as_qdr%3Dall%26pwst%3D1

This Might help a lot its an explaination of 3d objects and rotations etc:

http://www.euclideanspace.com/maths/geometry/rotations/

Textbook stuff:

http://translate.google.com/translate?hl=en&sl=es&u=http://eandres1.googlepages.com/lecci%C3%B3n7.&sa=X&oi=translate&resnum=27&ct=result&prev=/search%3Fq%3DgetOrientation%2Bblender%26num%3D50%26hl%3Den%26lr%3D%26sa%3DG%26as_qdr%3Dall%26pwst%3D1

Sad to say you gotta learn vector and matrix math (Grd 12 math at least) to use the orientation function, because it returns a matrix representing the orientation. Read a good book on graphics programming or just vector math. The orientation document previously posted doesn’t give a good explaination for someone who hasn’t a clue what a matrix is. Fortunately you dont actually need to know trig to work with orientation matrixes. Once you get your head around vector and matrix operations its pretty much as simple as algebra. Look up matrix multiplication, cross products,and vector operations on the net and you might not need a book on the subject.

Woah, thanks a LOT ititrx for all those tuts, I should be able to find something to help me out.

Zeglr, I think I’m starting to understand how they work. Hopefully I wont have to wait until 12th grade, but I guess we’ll just have to see.

you are welcome lol

Yeah, I definately see how I can use this now. Thanks so much, guys!

BTW, if I end up completely making this game, I’ll try to mention you guys in the credits. :wink:

http://blenderartists.org/forum/showthread.php?t=113172

Good luck with your project.

ititrx>

You trying out for “link master” or something? lol

Good job.

I read the first few paragraphs of it, and that should help a LOT. Thanks sooooooooo much!

And you’re not too late, I haven’t had the time to make any progress. :slight_smile:

Try this:

orient=object.getOrientation()
YVector=orient[1]
anotherObject.setPosition(YVector)

should work almost like parenting right? if the y is a vector that points in the object’s y direction, why doesnt “anotherObject” rotate in the same direction as "object"s Y axis?