Sign in to follow this  

How to rotate objects as in "orbiting"?

This topic is 2842 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I wanted to know what would be the correct formula for the rotation of an object in a 'orbiting' kind of rotation, given that I have access to the x, y and z rotation values of the object? I mean, right now if I just use a pretty simple formula which I got, it'll spin correctly and look to the sides, but when looking down, instead of spinning like if it was spinning around the planet, it'll just still look to the sides but while looking down, as if it was a first person shooter character. I'm looking for doing a first person shooter with space ships, and that requires me to have the ships look freely around, tilt as much as they want and still spin around correctly. I tried doing some modifications to the formula but I didn't get anything that worked. I'd be very grateful if someone could help me out with this. Thanks in advance!

Share this post


Link to post
Share on other sites
Quote:
Original post by omglol
I wanted to know what would be the correct formula for the rotation of an object in a 'orbiting' kind of rotation, given that I have access to the x, y and z rotation values of the object?
I mean, right now if I just use a pretty simple formula which I got, it'll spin correctly and look to the sides, but when looking down, instead of spinning like if it was spinning around the planet, it'll just still look to the sides but while looking down, as if it was a first person shooter character. I'm looking for doing a first person shooter with space ships, and that requires me to have the ships look freely around, tilt as much as they want and still spin around correctly. I tried doing some modifications to the formula but I didn't get anything that worked.

I'd be very grateful if someone could help me out with this. Thanks in advance!
Can you clarify? You mention 'orbiting' behavior and 'spinning around a planet', but it also kind of sounds like you're talking about first-person 6DOF motion, like in a space simulator.

Can you describe in a little more detail what type of behavior you're wanting? (Perhaps you could mention a game or two that includes this type of behavior, just so we have a point of reference.)

Share this post


Link to post
Share on other sites
Quote:
Original post by jyk
Quote:
Original post by omglol
I wanted to know what would be the correct formula for the rotation of an object in a 'orbiting' kind of rotation, given that I have access to the x, y and z rotation values of the object?
I mean, right now if I just use a pretty simple formula which I got, it'll spin correctly and look to the sides, but when looking down, instead of spinning like if it was spinning around the planet, it'll just still look to the sides but while looking down, as if it was a first person shooter character. I'm looking for doing a first person shooter with space ships, and that requires me to have the ships look freely around, tilt as much as they want and still spin around correctly. I tried doing some modifications to the formula but I didn't get anything that worked.

I'd be very grateful if someone could help me out with this. Thanks in advance!
Can you clarify? You mention 'orbiting' behavior and 'spinning around a planet', but it also kind of sounds like you're talking about first-person 6DOF motion, like in a space simulator.

Can you describe in a little more detail what type of behavior you're wanting? (Perhaps you could mention a game or two that includes this type of behavior, just so we have a point of reference.)


Sorry, I think it's that what you told me and I'm gonna search a little bit about it. I'm still a beginner on this game making stuff, I only started learning programming by myself a few years ago so I'm still a 'wannabe' here, don't quite know what terms to use and don't know how to express what I want to know ^^

Yes, what I meant was in a space simulator, a game which uses this kind of behavior is the first half of the Mothership map on Unreal Tournament 2004 (and actually all maps for that game which make use of the space ships actors which I don't remember the name, but there are quite a few more that use it, like Acatana and Jumpship), and it's been many years since I last played this, but the oldschool game Descent I think also has that kind of behavior.

But anyway, thanks for even mentioning the name of the subject I had to search for, I was completely lost on that one ^^

EDIT: I went to search more about this, couldn't find much that could help me, I guess this is no easy task? I actually found this http://kengine.sourceforge.net/tutorial/vc/camera-eng.htm
But problem is, I'm just testing out some programming on Conitec's 3D Game Studio so I can gather some more visual programming 'bits', since it's easier to do it there and I still have lots and lots and lots to learn about OpenGL. On that program, I can only rotate objects through the use of pan, pitch and roll. Is there a solution to doing that with what is given to me, or the only way is to try and translate all the formulas on that link to conitec's scripting language?


Thanks in advance

[Edited by - omglol on March 3, 2010 7:55:01 PM]

Share this post


Link to post
Share on other sites
Yeah, I think '6DOF' is the term you're looking for. There have been quite a few threads on this subject in the past, so a forum search for '6DOF motion' or '6DOF camera' should lead you to some good references.

Share this post


Link to post
Share on other sites
Quote:
Original post by jyk
Yeah, I think '6DOF' is the term you're looking for. There have been quite a few threads on this subject in the past, so a forum search for '6DOF motion' or '6DOF camera' should lead you to some good references.


Thank you very much, actually not being a very smart guy I searched directly in google rather than trying to search here first. I'll do a search for both 6dof, six degrees of freedom and Descent and see all the info I can gather.
Also, just now I figured out that, since I'm trying this out on 3D Game Studio for now, I should check out their site and see if there's already a game made with that for download so I could check out how the code is done ^^"

Thanks people

EDIT: I started writing this in C-Script language of 3D Game Studio based on the tutorial I found and posted on the other post. Soon I'll post here if I got it to work or not. Thanks again!

[Edited by - omglol on March 9, 2010 3:22:51 PM]

Share this post


Link to post
Share on other sites

This topic is 2842 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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