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 / semi circular move path.

Author
Message
Nic
20
Years of Service
User Offline
Joined: 26th Jun 2004
Location:
Posted: 27th Oct 2004 17:28
HI , maths was never my strong point so before i go brain busting maybe someone else already has this formula? i want to have my sprite once he has shot his sling shot thing to move in a semi circular swinging motion. Can any1 help? Thanks
Antdizzle
21
Years of Service
User Offline
Joined: 6th Mar 2004
Location: Las Vegas
Posted: 27th Oct 2004 17:33
I don't understand what you mean.
Nic
20
Years of Service
User Offline
Joined: 26th Jun 2004
Location:
Posted: 27th Oct 2004 19:46
[img]d:\home\2.jpg[/img]

maybe this helpS?
Nic
20
Years of Service
User Offline
Joined: 26th Jun 2004
Location:
Posted: 27th Oct 2004 19:47
ok never mind some1 can work it out
Xander
22
Years of Service
User Offline
Joined: 3rd Mar 2003
Location: In college...yeah!
Posted: 28th Oct 2004 00:42
Quote: "
d:\home\2.jpg

maybe this helpS?
"


No, it doesn't help...we can't access you hard drive or CD drive from here...

I will be able to help you, but you need to upload the picture so I can see what you are trying to do.

Xander Moser - Bolt Software - Firewall
computer
20
Years of Service
User Offline
Joined: 5th Oct 2004
Location:
Posted: 28th Oct 2004 02:32
You mean you would like the projectory line of the projectile after it has been fired? Like a rifle would fire in a straight line, but after a while would start to dip and hit the ground.
Your catapult would have a circular curve in the beginning, so I could see why you would want the formula.

bleep bleep
Xander
22
Years of Service
User Offline
Joined: 3rd Mar 2003
Location: In college...yeah!
Posted: 28th Oct 2004 03:13
Quote: "Like a rifle would fire in a straight line, but after a while would start to dip and hit the ground."


Actually, any projectile will begin moving towards the source of gravity (the ground on a planet) the instant that it is shot. Gravity takes effect immediatly, it never truly moves in a straight line unless it is shot straight up.

Niclaw: You want formulas for how the shot would move after being shot? That would not use sin and cos, but would use a parabolic path. Here is the equation for a parabola:

y=ax^2 + bx + c

or

y=a(x-h)^2 + k

The second one is easier to manipulate the constants to readjust the parabola. Have you had an algebra class? If so, you should have some experience. Otherwise I can explain how each constant effects the equation

Xander Moser - Bolt Software - Firewall
Nic
20
Years of Service
User Offline
Joined: 26th Jun 2004
Location:
Posted: 28th Oct 2004 15:33
ok sorry i wasnt very clear, i want the character to move on that plane. the best way of describing it is spiderman swingning from web.
Xander
22
Years of Service
User Offline
Joined: 3rd Mar 2003
Location: In college...yeah!
Posted: 29th Oct 2004 01:55
Okay, a guy swinging is a true circle, which is given by the following equation:

(x-h)^2 + (y-k)^2 = r^2

Where h,k is the center of the circle, and r is the radius of the circle.

Is your game 2D or 3D? There is actually a lot of physics involved here...I actually did this once, in a different programming language. I didn't do it the way you are supposed to though, I didn't use true physics. I am really really busy right now with school work. I will try to get back to you later, maybe with a small demo. I wish I could help, but I have no spare time...

Anybody here a physics expert?

Xander Moser - Bolt Software - Firewall
computer
20
Years of Service
User Offline
Joined: 5th Oct 2004
Location:
Posted: 30th Oct 2004 11:46
Well, I've done math before but I'm not good at it now, so I'll show you what I remember, and I know why it works.



hit a key when it starts up remember.

bleep bleep
Nic
20
Years of Service
User Offline
Joined: 26th Jun 2004
Location:
Posted: 30th Oct 2004 16:33
thanks everyone for putting the time in, Im a few thousand miles away from home at the moment so i cant try it just yet. Its a 2d Games at the moment but maybe when i get back i will try a 3D approach.
MrSteve
20
Years of Service
User Offline
Joined: 1st Nov 2004
Location: Omnipresent
Posted: 1st Nov 2004 23:10
Hello, this is my first time here, so hi everyone, and i err think i know what your on about, check flash animation and tell me is this what you mean? http://uk.msnusers.com/IsThisWhatYouMean/documents.msnw?&pps=k

A bump on the head........ is worth two in a bush?
Nic
20
Years of Service
User Offline
Joined: 26th Jun 2004
Location:
Posted: 2nd Nov 2004 13:59
Sorry the link isnt working for me, it takes me to the main page of MSN users.
Underworld 1020
21
Years of Service
User Offline
Joined: 2nd Mar 2004
Location: NY, USA
Posted: 3rd Nov 2004 00:07
All I know is that all objects fall at 10m/s squared. That is without wind resistence; I got physics next period.

I don't know if that helps

See Ya!
Xander
22
Years of Service
User Offline
Joined: 3rd Mar 2003
Location: In college...yeah!
Posted: 3rd Nov 2004 03:27
Quote: "All I know is that all objects fall at 10m/s squared"


Actually, objects accelerate to the source of earth's gravity at 9.807 m/s^2.

Sorry, I had to use my knowledge of basic physics somewhere...

Xander Moser - Bolt Software - Firewall
computer
20
Years of Service
User Offline
Joined: 5th Oct 2004
Location:
Posted: 3rd Nov 2004 05:40
But your not going to make a small program that helps? Put your stuff to practice, I'm terrible at this. I can't figure out anything from the equations I've seen.

If anyone can produce a small lot of code that can draw a circle from 1 to 360 degrees I'll be happily look at it.

bleep bleep
Xander
22
Years of Service
User Offline
Joined: 3rd Mar 2003
Location: In college...yeah!
Posted: 3rd Nov 2004 08:27
Sorry about that...got a little off track.

Code that draws a circle? Sure, here it is:



Xander Moser - Bolt Software - Firewall
computer
20
Years of Service
User Offline
Joined: 5th Oct 2004
Location:
Posted: 4th Nov 2004 06:32
Quote: "Code that draws a circle? Sure, here it is:"


That is fantastic! I'll have to see why I'm getting so mind bent on the position of the current position. When you go past a quarter of the circle, you won't be able to perform the same cosine, sine or tangent because of minus numbers.. that's what was annoying me.

I liked the code. It seemed very professional for a example. You do know about the set text opaque command? You don't need to draw a black box over the top of the text then.

bleep bleep
Xander
22
Years of Service
User Offline
Joined: 3rd Mar 2003
Location: In college...yeah!
Posted: 5th Nov 2004 00:18
Quote: "You do know about the set text opaque command? You don't need to draw a black box over the top of the text then."


Good point...forgot about that command...

Quote: "When you go past a quarter of the circle, you won't be able to perform the same cosine, sine or tangent because of minus numbers.. "


I don't quite understand your comment though, do you need help understanding something with trigonometry?

Xander Moser - Bolt Software - Firewall
Chris K
21
Years of Service
User Offline
Joined: 7th Oct 2003
Location: Lake Hylia
Posted: 5th Nov 2004 00:49
Sin does work with all angles.

It's one of the greatest and most important mathmatical funcions ever.

Login to post a reply

Server time is: 2025-05-24 17:00:08
Your offset time is: 2025-05-24 17:00:08