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 Sine wave

Author
Message
Silicon Zombie
16
Years of Service
User Offline
Joined: 7th Oct 2007
Location: UK
Posted: 6th Dec 2007 22:37
I appologise if this post is either really cheeky or really silly, but please keep in mind its been over 20 years since i went to school.

Right, i know what a sine wave looks like, but i want to know how its plotted. ive searched on google for a maths site, and i cannot find out how its done.

if someone could explain, or a little example of say a letter move across the screen plotted with a sine wave, i would be really grateful.

Thanks in advance.
Dr Schnitzengruber
17
Years of Service
User Offline
Joined: 19th Jul 2007
Location: C:/Projects/failed/ schnitzengruber
Posted: 7th Dec 2007 00:06 Edited at: 7th Dec 2007 00:08
If you want a quick DBPro plot:



Silicon Zombie
16
Years of Service
User Offline
Joined: 7th Oct 2007
Location: UK
Posted: 7th Dec 2007 01:18
Thanks very much for replying but that code appears to only draw a straight line.... also can I ask why is t being divided by 4.0?

Regards.
Dr Schnitzengruber
17
Years of Service
User Offline
Joined: 19th Jul 2007
Location: C:/Projects/failed/ schnitzengruber
Posted: 7th Dec 2007 02:33 Edited at: 7th Dec 2007 02:34
opps, sorry:



t can be divided by any number, you don't even have to divide it. I only did it to increase frequency. Here is the basic syntax for a sine wave:



Silicon Zombie
16
Years of Service
User Offline
Joined: 7th Oct 2007
Location: UK
Posted: 7th Dec 2007 02:50
You are a star!!! Thank you so much!

I wish id paid more attention at school....

Incase you were wondering (although probably not)

The reason I wanted the sine wave was for a bouncy scrolling text. At the moment my bounce is a very lame collection of If's that moves the text on the x,y between two values to make the bounce.....

Also I wanted it to possibly use it in sprite movement aswell.

Thanks again. (I will credit you for the help!)

Regards
Rudolpho
18
Years of Service
User Offline
Joined: 28th Dec 2005
Location: Sweden
Posted: 7th Dec 2007 16:38
Just for the sake of it....



"I kören hörs de brummande busarna Björnligan och Gondolen"
Silicon Zombie
16
Years of Service
User Offline
Joined: 7th Oct 2007
Location: UK
Posted: 9th Dec 2007 11:31
Sorry Rudolpho, I forgot to thank you aswell.

Could a moderator please lock this topic, as the question has been completely answered.

Thanks again guys.

Regards.

Login to post a reply

Server time is: 2024-09-27 08:29:53
Your offset time is: 2024-09-27 08:29:53