Support

If you have a problem or need to report a bug please email : support@dsprobotics.com

There are 3 sections to this support area:

DOWNLOADS: access to product manuals, support files and drivers

HELP & INFORMATION: tutorials and example files for learning or finding pre-made modules for your projects

USER FORUMS: meet with other users and exchange ideas, you can also get help and assistance here

NEW REGISTRATIONS - please contact us if you wish to register on the forum

How to make: Visual ping pong ball with sound or polyrithms

Post any examples or modules that you want to share here

How to make: Visual ping pong ball with sound or polyrithms

Postby mayo » Wed Jan 17, 2024 2:05 pm

Hello,

dont you have idea how to create this exactly? (example video below) visual+sound, which software to use? Is it possible easily in Flowstone or you suggest some other software? (need it for one music visual project, thanks a lot)

Here is example:
https://www.facebook.com/reel/756111399756982
mayo
 
Posts: 36
Joined: Fri Oct 19, 2007 2:53 pm

Re: How to make: Visual ping pong ball with sound or polyrit

Postby billv » Wed Jan 17, 2024 10:45 pm

Thank God I'm not alone!. For several years I was obsessed with how to make a bouncing ball
in FS. I always failed, because you need to create some sort of physics engine. :?
A physics engine is my number one dream for FS, opening the door for some serious Game development. 8-)
I use software called "Fusion", is a perfect example of how a physics engine in FS should behave...with shitloads
of user control options. Right now I'm be happy with a box with a bouncing ball inside...any Guru's out there
looking for a challenge?? :?:
Thanks
billv
 
Posts: 1146
Joined: Tue Aug 31, 2010 3:34 pm
Location: Australia

Re: How to make: Visual ping pong ball with sound or polyrit

Postby tulamide » Thu Jan 18, 2024 1:45 am

mayo wrote:Hello,

dont you have idea how to create this exactly? (example video below) visual+sound, which software to use? Is it possible easily in Flowstone or you suggest some other software? (need it for one music visual project, thanks a lot)

Here is example:
https://www.facebook.com/reel/756111399756982

Exactly? No.
If you don't need the trail of past circles, it isn't difficult to do in Flowstone, though. Too much to explain in short, I'm afraid.
"There lies the dog buried" (German saying translated literally)
tulamide
 
Posts: 2688
Joined: Sat Jun 21, 2014 2:48 pm
Location: Germany

Re: How to make: Visual ping pong ball with sound or polyrit

Postby tulamide » Thu Jan 18, 2024 2:00 am

billv wrote:Thank God I'm not alone!. For several years I was obsessed with how to make a bouncing ball
in FS. I always failed, because you need to create some sort of physics engine. :?
A physics engine is my number one dream for FS, opening the door for some serious Game development. 8-)
I use software called "Fusion", is a perfect example of how a physics engine in FS should behave...with shitloads
of user control options. Right now I'm be happy with a box with a bouncing ball inside...any Guru's out there
looking for a challenge?? :?:
Thanks

I did this once, at it isn't very difficult to be honest. First you set up gravity. It means a direction where the circle is pulled to contantly. For example to the bottom. Let's just set our gravity to 4 pixels per second.

You loop-call a method that applies 4 pixels per second (via deltatime) to the direction "bottom".

-method gravity
dt = t - time
t = time
circleforcebottom += 4 * dt
end method

With this alone, when placing a circle at the top of the screen, it will gain velocity and move gradually faster and faster towards the bottom.

Combine this with a "ground": an immovable object that will decelerate motion to zero, if no bouncing force exists. If it exists, you add the bouncing force to the circle, and it will accelerate towards the top, until the gravity moves it down again. Friction is defining the material of the "ground". When the circle moves on the ground, this is the amount by which it will slow down - it loses momentum. And lastly: angle of incident = angle of emergence. If the circle hits the "ground" at 30°, it will leave it at mirrored 30°. The curve it will take builds automatically from the applied gravity force.

And so on. Really, it isn't very difficult, once you start it. It is just very time consuming.
"There lies the dog buried" (German saying translated literally)
tulamide
 
Posts: 2688
Joined: Sat Jun 21, 2014 2:48 pm
Location: Germany

Re: How to make: Visual ping pong ball with sound or polyrit

Postby RJHollins » Thu Jan 18, 2024 2:25 am

Love it when you explains things Tulamide !

Thanks.
RJHollins
 
Posts: 1568
Joined: Thu Mar 08, 2012 7:58 pm

Re: How to make: Visual ping pong ball with sound or polyrit

Postby mayo » Sun Jan 21, 2024 12:15 pm

tulamide wrote:
billv wrote:Thank God I'm not alone!. For several years I was obsessed with how to make a bouncing ball
in FS. I always failed, because you need to create some sort of physics engine. :?
A physics engine is my number one dream for FS, opening the door for some serious Game development. 8-)
I use software called "Fusion", is a perfect example of how a physics engine in FS should behave...with shitloads
of user control options. Right now I'm be happy with a box with a bouncing ball inside...any Guru's out there
looking for a challenge?? :?:
Thanks

I did this once, at it isn't very difficult to be honest. First you set up gravity. It means a direction where the circle is pulled to contantly. For example to the bottom. Let's just set our gravity to 4 pixels per second.

You loop-call a method that applies 4 pixels per second (via deltatime) to the direction "bottom".

-method gravity
dt = t - time
t = time
circleforcebottom += 4 * dt
end method

With this alone, when placing a circle at the top of the screen, it will gain velocity and move gradually faster and faster towards the bottom.

Combine this with a "ground": an immovable object that will decelerate motion to zero, if no bouncing force exists. If it exists, you add the bouncing force to the circle, and it will accelerate towards the top, until the gravity moves it down again. Friction is defining the material of the "ground". When the circle moves on the ground, this is the amount by which it will slow down - it loses momentum. And lastly: angle of incident = angle of emergence. If the circle hits the "ground" at 30°, it will leave it at mirrored 30°. The curve it will take builds automatically from the applied gravity force.

And so on. Really, it isn't very difficult, once you start it. It is just very time consuming.



Wow thank you, any chance you can post some example here?

Btw. I know way how to make some crazy money with this :lol: not joking really
if you want to cooperation

Thanks
mayo
 
Posts: 36
Joined: Fri Oct 19, 2007 2:53 pm

Re: How to make: Visual ping pong ball with sound or polyrit

Postby billv » Wed Feb 07, 2024 9:10 am

mayo wrote:any chance you can post some example here?

Yes... a working example would be great...as I still can't work it out... :?
billv
 
Posts: 1146
Joined: Tue Aug 31, 2010 3:34 pm
Location: Australia

Re: How to make: Visual ping pong ball with sound or polyrit

Postby tulamide » Wed Feb 07, 2024 11:38 am

I don't have the time to do it. But here's an interactive example. The code is on the right (Javascript - JS, very similar to Ruby)

https://codepen.io/AlexRA96/pen/egaxVV
"There lies the dog buried" (German saying translated literally)
tulamide
 
Posts: 2688
Joined: Sat Jun 21, 2014 2:48 pm
Location: Germany

Re: How to make: Visual ping pong ball with sound or polyrit

Postby billv » Thu Feb 08, 2024 4:36 am

tulamide wrote:The code is on the right (Javascript - JS, very similar to Ruby)

Thanks Tulamide ....I'm looking into it..
I found this online...might help
Code: Select all
# Define the Ruby Component class
class BouncingBall < RubyComponent
  # Initialize the component
  def initialize
    # Define instance variables for ball position and speed
    @ball_x = 320
    @ball_y = 240
    @ball_speed_x = 5
    @ball_speed_y = 5
    @ball_radius = 20
  end

  # Update method to move the ball and handle collisions
  def update
    @ball_x += @ball_speed_x
    @ball_y += @ball_speed_y

    # Check for collision with window edges
    if @ball_x + @ball_radius > getWidth || @ball_x - @ball_radius < 0
      @ball_speed_x *= -1
    end

    if @ball_y + @ball_radius > getHeight || @ball_y - @ball_radius < 0
      @ball_speed_y *= -1
    end
  end

  # Draw method to draw the ball
  def draw
    fill_ellipse(@ball_x - @ball_radius, @ball_y - @ball_radius, @ball_radius * 2, @ball_radius * 2, "red")
  end
end
billv
 
Posts: 1146
Joined: Tue Aug 31, 2010 3:34 pm
Location: Australia


Return to User Examples

Who is online

Users browsing this forum: No registered users and 46 guests