Camera/Object Rotations in Local Axes

Yes, Michael Steinberg, I’d love to have a function that does that very thing! It sounds extremely useful! Thanks for the offer! Sorry if I sound sarcastic, I’m actually really excited about this function.
I guess I could rotate a ship with it by getting a vector perpendicular to the ship’s heading and then rotate the ship around that vector for pitch? And I can do a similar thing for roll and yaw. AWESOME! Exactly what I’ve been looking for!

[This message has been edited by Punchey (edited 11-29-2000).]

That was exactly my thought! I needed a way to rotate the world like it would if you sit in a space ship (since I prog a (little)space engine).
Usage should be clear. Comments are in german but are also very rare…

To make all that stuff, keep in mind, that the rows in the matrix represent the axes, to2down: xyz. At least I think so, and now it’s looking all very fantastic (for me…).

It’s gonna go out within the next hour!

Just reread you last post.

The way to go is:
1.Get the identity matrix into your rotation matrix.

Then for every frame:
You get the local axis-rotation-speeds. So, get the axes out of your rotation matrices, get the rotation matrix around these vectors and multiply it with your main rotation matrix.
And then, you can use the z-axis also for the movement direction, but you probably know that…

Michael,

You’re right! The first three elements of the first three rows of your matrix are your local i,j,k vectors. I used to know that, but it got away from me in the years I wasn’t playing with this stuff. Thanks a ton for pointing this out I should be able to greatly simplify my code now! This is great, all this stuff is really starting to fall together in my head and make sense from talking with you guys.

Thanks again everyone,
-BradlyP

Hello all,

After realizing, with help from Michael, that the i,j,k vectors are part of the object matrix (duh!) I realized that what I was trying to do is MUCH simpler than I was making it. I modified my program so it has much simplified code for using an object as the camera which doesn’t need to use those matricies I’d set up for jVector and kVector… and in fact doesn’t need to do any matrix manipulation other than the call to gluLookAt to set up the viewing matrix. I emailed the updated code to Punchey and dnstapes - just throw out what I sent you before.

If anyone else wants a copy, just let me know what your email address is and I’ll be happy to send it (it’s about 90k zipped).

Regards,
-BradlyP

i’d like to have a copy of your work.
maybe what you did is more efficient than my method.

DMY

[This message has been edited by dmy (edited 11-30-2000).]

I would like that file also Bradly.
Email is atilahan@hotmail.com

Thanks again for taking the time to send it!

[This message has been edited by Elixer (edited 11-30-2000).]

I think I could also learn of what you did! It’d be nice if you sent it to me!

th-steinberg@t-online.de

Thanks!!!

BradlyP, Send one here too, mm012@yahoo.com

Thanks a lot

Hello all,

I’ll send copies to those that requested them in a little bit. The copies I sent to some of you already will not compile because of the following lines:

#include “mat_vec1.h”
#include “object1.h”

#ifdef _WIN32
#include “OpSysWin32.h”
#endif

Just comment out or delete these lines and you should be able to compile w/o any trouble. If you have any more questions, just ask!

Regards,
-BradlyP

[This message has been edited by BradlyP (edited 11-30-2000).]

[This message has been edited by BradlyP (edited 11-30-2000).]

Hello all,
I just wanted to pass along a bug in the code that I’ve sent to Punchey, dnstapes, and DMY. Near the top of the main loop in WinMain(), Change the following:

if (frameTime > 0) {
fRate = (int)(1000.0f/(float)frameTime);
} else {
fRate = (int)999;
}

To this:

if (frameTime > 0) {
fRate = (int)(1000.0f/(float)frameTime);
} else {
frameTime = 0;
fRate = (int)999;
}

(just add the “frameTime = 0;” line)

This was causing my machine to occasionally freeze up until I moved the mouse (at least I think this is what it was…). If you’d like me to email the newest code/executable, just email me and let me know…

… in fact,if anyone would like, I’ll gladly keep you updated with new “releases” of my code whenever I make significant changes. Just let me know and I’ll make a little mailing list (I don’t want to clog up people’s mailboxes w/ large messages if they don’t want me to).

I’ll be sending out this stuff to those who recently requested it later tonight.

Regards,
-BradlyP

[This message has been edited by BradlyP (edited 11-30-2000).]

Update: that wasn’t the problem. If anyone else is having this problem (the program freezing until you move the mouse), please let me know… I have a feeling it may be that something is a bit wonky w/ my Win2K installation (it doesn’t happen on my other machine).

Thanks,
-BradlyP

Originally posted by BradlyP:
[b]Hello all,

If anyone else wants a copy, just let me know what your email address is and I’ll be happy to send it (it’s about 90k zipped).

Regards,
-BradlyP[/b]

I’d like to get a copy … too
thanx in advance,
rangaroek

Originally posted by BradlyP:
[
I’ll happily zip up my program and email it to you (it might be kind of big…). I’m using MSVC 6, but I’m not using any MFC stuff.

Hope this helps,
-BradlyP

[This message has been edited by BradlyP (edited 11-28-2000).][/b]

Hi -

I am also working on this kind program. Can you please email me a copy of your program, thanks.

odysseykre@yahoo.com

thanks

Hello everyone,

Well, since so many people have asked for my code, I’ve put it on my (old, outdated, lame) web site. Here’s the page where you’ll find the files:

http://www.geocities.com/siliconvalley/5300/pc/opengl/

If anyone wants me to keep them updated when a new version is put on the site, please send me an email (my email address is on my web site). I’ll put together an email list to let you know when there’s new code there.

Thanks,
-BradlyP