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 / A silly little question about orbit and years

Author
Message
Daryn Alsup
16
Years of Service
User Offline
Joined: 5th Jul 2008
Location: In your head... dun dun DUN!!!!!!!!
Posted: 27th Feb 2010 00:25
I have an object orbiting another. Every time it completes a full orbit, how would I increment a year value. now I have tried the
method, but because the angle is a float (So the object rotation appears smooth) the remaining values, or 359.01... up to 359.99999 bar cause the year value to increment more then it should. So I am really looking for a way to increment a year value via some form of equation related to orbit rather than a process such as the one above. Any ideas or help is greatly appreciated.

-D

Jack and Jill went up a hill to fetch a pale of water... but Jill got tired of his s#%& so she shot him.
D Ogre
21
Years of Service
User Offline
Joined: 19th Nov 2003
Location:
Posted: 27th Feb 2010 06:03
Are you limiting the range of Angle# from 0 to 360 degrees somewhere in your code?
Otherwise any values beyond what your checking will increment the year continuously..

Example:


I would normally suggest using the WRAPVALUE() function to limit the range to within
360 degrees, but for some reason it was acting quite strangely on my internet PC.
So, that is why I my example here doesn't make use of it.
Rudolpho
18
Years of Service
User Offline
Joined: 28th Dec 2005
Location: Sweden
Posted: 27th Feb 2010 09:51
In the loop:



D Ogre
21
Years of Service
User Offline
Joined: 19th Nov 2003
Location:
Posted: 28th Feb 2010 04:02
@ Rudolpho

That was pretty much what I was going to post, but the WRAPVALUE() was causing the year to increment by tens on my internet PC. Very odd behavior. I thought I stumbled on a bug in 7.4. I haven't tried the code again since my last post. Have to look at it again later. Thanks for posting a more preferred way.

Login to post a reply

Server time is: 2024-11-23 19:37:26
Your offset time is: 2024-11-23 19:37:26