Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / Stuck again with New Value for Orbit

Author
Message
MatriX
21
Years of Service
User Offline
Joined: 19th Oct 2003
Location: Deer Park, New York
Posted: 4th Jan 2009 00:17 Edited at: 4th Jan 2009 00:18
Trying to build some 360 x 360 degree orbit code for my personal library here. I'm having no trouble getting the Y axis orbit rotation correct. The Z on the other hand is killing me. I don't know if it's just not possible or if I'm missing the something. I know I should probably using SIN, COS, TAN but I'm just not good in math and I prefer to use these commands as they are more "beginner" intended. The new value command seems to do what I want but I just cant get it right. Thanks if you can help!

Left / Right arrow keys Orbit around Y axis.
Up / Down arrow keys should orbit around Z Axis.



Wannabe Game Designer. Wannabe Programmer. Expert Dreamer.
Long Island Amateur Game Development Group http://www.meetup.com/LIAGDG/
BMacZero
18
Years of Service
User Offline
Joined: 30th Dec 2005
Location: E:/ NA / USA
Posted: 4th Jan 2009 00:30 Edited at: 4th Jan 2009 00:30
Angles give me a headache, too. There's a cheap trick I use for pan stuff like this:

Each loop, do this:
1.) Position the object you want to rotate at the location it will be rotating around.
2.) Rotate in the direction you want it to pan (for example, if you wanted it to orbit in the position x-angle direction, you would rotate it a little on the x)
3.) Use the command MOVE OBJECT to move it the distance away from the center of rotation you want it to be, multiplied by -1. (Moving it back away from the planet).

Also, zrotating the object I think just spins it. You may want to only rotate it on the X and Y (not sure about this).

MatriX
21
Years of Service
User Offline
Joined: 19th Oct 2003
Location: Deer Park, New York
Posted: 4th Jan 2009 04:42
Hmm I may have to resort to that but I was really hoping to be able to do it with Newvalue.

Just thinking outloud here:...

(included a diagram)

If it can't be done I'd like to hear an explanation if possible..thanks.

Wannabe Game Designer. Wannabe Programmer. Expert Dreamer.
Long Island Amateur Game Development Group http://www.meetup.com/LIAGDG/

Attachments

Login to view attachments
MatriX
21
Years of Service
User Offline
Joined: 19th Oct 2003
Location: Deer Park, New York
Posted: 4th Jan 2009 19:38
How do I get the attachment above to view as part of the message? I only can see it via download or view

Wannabe Game Designer. Wannabe Programmer. Expert Dreamer.
Long Island Amateur Game Development Group http://www.meetup.com/LIAGDG/
Virtual Nomad
Moderator
18
Years of Service
User Offline
Joined: 14th Dec 2005
Location: SF Bay Area, USA
Posted: 4th Jan 2009 20:12 Edited at: 4th Jan 2009 20:29
you use the image button (above the smilies in the post/edit area). it will insert the bb code into your message and where it says null you should cut and paste the shortcut/url to the view button for that post (right click view and 'copy shortcut' on ie).



hope that makes sense

also, while you can upload the image/attachment when you first post your message, it won't have a URL address until you submit the post, which means:
1) you'll need to make your initial post and upload the image, then
2) grab the address from the 'view' button, then
3) edit your post and insert the image into the body of the message as mentioned above.

you can also just use the bbcode [ img] http://www.url here.com [/ img] (without the spaces).

Virtual Nomad @ California, USA
AMD Phenomâ„¢ X4 9750 Quad-Core @ 2.4 GHz . 8 GB PC2-6400 RAM
ATI Radeon HD 3650 @ 512 MB . Vista Home Premium 64 Bit
MatriX
21
Years of Service
User Offline
Joined: 19th Oct 2003
Location: Deer Park, New York
Posted: 4th Jan 2009 23:39 Edited at: 6th Jan 2009 02:15
Ahhh thanks alot. LOL i missed the image button. I feel silly now.

Wannabe Game Designer. Wannabe Programmer. Expert Dreamer.
Long Island Amateur Game Development Group http://www.meetup.com/LIAGDG/
MatriX
21
Years of Service
User Offline
Joined: 19th Oct 2003
Location: Deer Park, New York
Posted: 6th Jan 2009 02:14 Edited at: 6th Jan 2009 02:15
This is interesting although I wish it orbited over and under the cube as well. At least it sort of accomplishes the task.



Wannabe Game Designer. Wannabe Programmer. Expert Dreamer.
Long Island Amateur Game Development Group http://www.meetup.com/LIAGDG/
MatriX
21
Years of Service
User Offline
Joined: 19th Oct 2003
Location: Deer Park, New York
Posted: 6th Jan 2009 03:48
Well I found what looks to be the solution.

Many thanks to Rye in this post:

http://forum.thegamecreators.com/?m=forum_view&t=45887&b=1

I changed his camera orbit code and made it work with my objects instead. (Sorry for the lack of comments. If you look at the original post he commented very well.)



Solved but I'm not sure why yet. I have to investigate and definitley brush up on my trigonometry.

Wannabe Game Designer. Wannabe Programmer. Expert Dreamer.
Long Island Amateur Game Development Group http://www.meetup.com/LIAGDG/

Login to post a reply

Server time is: 2024-11-24 14:35:19
Your offset time is: 2024-11-24 14:35:19