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.

AppGameKit Studio Chat / [SOLVED] throwing a ball

Author
Message
ruckertheron
7
Years of Service
User Offline
Joined: 12th Nov 2016
Location:
Posted: 20th Sep 2021 03:24
Does any body know how to throw a ball so to speak? As in the image in 2D from one point to the other?

Attachments

Login to view attachments

The author of this post has marked a post as an answer.

Go to answer

Virtual Nomad
Moderator
18
Years of Service
User Offline
Joined: 14th Dec 2005
Location: SF Bay Area, USA
Posted: 20th Sep 2021 05:50 Edited at: 20th Sep 2021 06:17
years ago i asked a young scholar this same question and he wandered off and came back ~1/2 an hour later with 4 pages of "work".

his eyes were intense and un-blinking (he'd just slain the beast, after all) as i took the pages and thanked him.

i wandered off (read "hid") and tried piecing it together. unable to make heads nor tails from it, i stuffed the notion deep under my mind.

now you've prompted me to revisit so i watched a series of (4) videos beginning HERE.

in short (from part 3):


(that's solving the angle with a given initial velocity)

i'll need to watch it again once my brain forgives me before attempting to code the functions, but it's a start? (unless someone's already done it... i should have searched before diving into the rabbit hole)

btw, IIRC correctly, the beginning of the series declares that this will not account for (air?) resistance (and, no wind). i expect that's a 10-part series.

add MORE
[My Itch.io Home] [AGK on Itch.io]
[AGK Resource Directory] [TGC @ GitHub]
[CODE lang=agk] YOUR CODE HERE [/CODE]
[VIDEO=youtube] VIDEO ID [/VIDEO]
[AGK Showcase][Google Forum Search]

Attachments

Login to view attachments
Scraggle
Moderator
20
Years of Service
User Offline
Joined: 10th Jul 2003
Location: Yorkshire
Posted: 20th Sep 2021 09:50
I searched "ballistic" on the forum and it returns quite a few results. I haven't looked at any of them but there might be some gold dust amongst them.
PartTimeCoder
AGK Tool Maker
9
Years of Service
User Offline
Joined: 9th Mar 2015
Location: London UK
Posted: 20th Sep 2021 12:23 Edited at: 20th Sep 2021 12:49
This post has been marked by the post author as the answer.
A quadratic Bézier curve would solve the this, No?

Edit: fixed bug in code!


Open Source plugins
Cl - DnD Plugin
Buy Me A Coffee

Attachments

Login to view attachments
blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 20th Sep 2021 12:54
Man. That is the bomb diggidy! |
PartTimeCoder
AGK Tool Maker
9
Years of Service
User Offline
Joined: 9th Mar 2015
Location: London UK
Posted: 20th Sep 2021 13:03
Thanks, But I take no credit for the idea, all I did was apply it to AGK

I love this guys enthusiasm
Open Source plugins
Cl - DnD Plugin
Buy Me A Coffee
PartTimeCoder
AGK Tool Maker
9
Years of Service
User Offline
Joined: 9th Mar 2015
Location: London UK
Posted: 20th Sep 2021 16:04 Edited at: 20th Sep 2021 16:05
For even greater control of the curve arc, a Cubic Bezier curve (I like this one)





Open Source plugins
Cl - DnD Plugin
Buy Me A Coffee

Attachments

Login to view attachments

Login to post a reply

Server time is: 2024-04-19 13:05:46
Your offset time is: 2024-04-19 13:05:46