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.

DarkBASIC Discussion / Kirby animation using sin() and cos() commands - need help

Author
Message
TheComet
17
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 11th May 2008 21:37 Edited at: 11th May 2008 21:38
I made my first kirby animation demo (Kirby animation #001) and Nex the Fairly fast Ferret advised me to use the sin() and cos() to smooth the robotic effect of my model. I am using the interpolation method (keyframes) for you to get an Idea how and what I`m doing. The model is totally generated by the code and there is no media (except for the face).

How do I use the sin() / cos() command? To make things easy, I will not post the kirby code, all I want is an animated object swinging back and forwards using the sin() and cos() commands and interpolation (keyframes), and I can add that to my kirby model.

Here is how I animated kirby: Build on this example for the swinging object



many thanks, TheComet

Oooooops!!! I accidentally formated drive c.
NeX the Fairly Fast Ferret
20
Years of Service
User Offline
Joined: 10th Apr 2005
Location: The Fifth Plane of Oblivion
Posted: 11th May 2008 23:03
What are the exact keyframes of your Kirby model?


I fail at life. No, really.
Libervurto
18
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 12th May 2008 01:51
both sine and cosine have peaks and troughs; movent becomes dampened before reversing at these points.
you've probably used sin and cos to draw circles; by altering their values you can make different patterns.

ill write up a pendulum program as an example ...

It is far better to complete a 10 line program than to start a 10,000 line program.
BMacZero
19
Years of Service
User Offline
Joined: 30th Dec 2005
Location: E:/ NA / USA
Posted: 12th May 2008 02:46
I don't know a lot about sine and cosine, but you need to scale the face down a bit, it's creepily large

Unterseeboot - Has you played it?
Los Mineros are on leave...
Not_Maindric
17
Years of Service
User Offline
Joined: 10th Jul 2007
Location: Omaha, NE
Posted: 12th May 2008 02:57
All I saw was a yellow rectangle...

TheComet
17
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 12th May 2008 11:18
Quote: "I don't know a lot about sine and cosine, but you need to scale the face down a bit, it's creepily large "


ha,ha,ha,ha! It`s good you mention that!

@Obese87

Sure thing! Thanks

Oooooops!!! I accidentally formated drive c.
Libervurto
18
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 13th May 2008 05:29 Edited at: 13th May 2008 06:01
sorry, I did my old trick of saying I'll post something then running off
I wrote the program last night so I will find it and post
be patient though I'm using PS3 controller to type...

[edit]
This is a very simple way to get a semi-circular movement using sin and cos.

Simply by removing the ABS, that restricts the cosine to positive values, the pendulum would travel a complete circle.
Both sine and cosine travel between 1 and -1, using ABS on cosine we turn the path from 0 to -1 into a path from 0 back to 1. So the pendulum never rises above the fulcrum.

It is far better to complete a 10 line program than to start a 10,000 line program.
TheComet
17
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 14th May 2008 09:07
Thats cool! Now I need to add that movement to my kirby.

Oooooops!!! I accidentally formated drive c.
Libervurto
18
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 15th May 2008 01:02
play around with that pendulum program and see what interesting movements you can make.
Sin and cos are very interesting; when used in tandem (ie drawing a circle) they appear to change smoothly, this is because they are offset from each other and balance out: when one is changing rapidly the other exhibits little change, and vice versa.
upsetting the balance produces more erratic movements.

It is far better to complete a 10 line program than to start a 10,000 line program.
Invincibob 8
17
Years of Service
User Offline
Joined: 4th Feb 2008
Location: Some Place Somewhere
Posted: 27th Jul 2008 07:41
You had better finish that game. Those who start a Kirby game without finishing it are evil!

Once, I fell of a bridge and died. When I came back, I decided to haunt this forum.
TheComet
17
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 27th Jul 2008 15:36 Edited at: 27th Jul 2008 15:46
@ Invincibob 8

Kirby Factory

and download the code attached...

This is all just the start! When I get the game finished, you will be so scared, that you will jump off that bridge again and quit haunting this forum!!

TheComet

Your signature has been erased by a mod - Please reduce it to 600x120 maximum size

Attachments

Login to view attachments

Login to post a reply

Server time is: 2025-06-07 06:35:06
Your offset time is: 2025-06-07 06:35:06