The Daily Click ::. Forums ::. Klik Coding Help ::. Decrease sin speed. Need your help.
 

Post Reply  Post Oekaki 
 

Posted By Message

savvy001



Registered
  27/03/2007
Points
  295
30th October, 2011 at 02:13:02 -

Im making spheres orbiting a other sphere.
So far so good.

I need a way to be able to control the speed of the sin movement like a just few pixels per second maybe.
and even minutes,hours or days etc.
At this point when i set the rotation value to 1 it already has far to much speed.
What i want with this is to connect the spheres orbit to the realtime clock using the ''date & time'' object or some other if u have a great idear.

Thanx in advance


 
Living in space

UrbanMonk

BRING BACK MITCH

Registered
  07/07/2008
Points
  49667

Has Donated, Thank You!Little Pirate!ARGH SignKliktober Special Award TagPicture Me This Round 33 Winner!The Outlaw!VIP MemberHasslevania 2!I am an April FoolKitty
Picture Me This Round 32 Winner!Picture Me This Round 42 Winner!Picture Me This Round 44 Winner!Picture Me This Round 53 Winner!
30th October, 2011 at 03:04:20 -

Make a custom movement using the sin() function.

So you would do something like this,

Set x pos of sphere to
xpos("sphere2") + sin(realtime clock) * distance

And you can prolly figure out the rest.

 
n/a

savvy001



Registered
  27/03/2007
Points
  295
30th October, 2011 at 04:13:35 -

Il try it out thanx!

 
Living in space

savvy001



Registered
  27/03/2007
Points
  295
30th October, 2011 at 04:32:39 -

Ok the time setting is correct now but the next thing has come up.

The sphere orbits in 360 degr but because the sin is set up to seconds it only completes 60 of the 360 degr.
When the seconds return to zero the orbiting sphere does it also.
In my logic i would say 'just continue on path' but i dont know how to translate it to code.
Got no qlue what to do?


 
Living in space

savvy001



Registered
  27/03/2007
Points
  295
30th October, 2011 at 04:56:12 -

Ive got it!

I used the (time X) object.

I set the time x object to: every seconds of( "Date & Time" )-1000 ad 1 to New entry timestamp counter.

Then i set the sphere to:
X( "Center" )+Cos(value( "New entry timestamp counter" ))*Dist( "Sphere" )
Y( "Center" )-Sin(value( "New entry timestamp counter" ))*Dist( "Sphere" )

The counter just ads up so i dont have a 60 seconds limit to my orbit rotation anymore!
Thanx for the help!
It worked out fine



 
Living in space
   

Post Reply



 



Advertisement

Worth A Click