What's a really good simulation software?

Thread Starter

arduinolego611

Joined Jan 23, 2022
75
I would like to be able to make a bouncing ball simulation based on c++ code I've already written. Something where I can use code to simulate a bouncing ball in a graphical window.

I would like to do it in my web browser so I don't have to download anything, but if that doesn't exist (which I suspect it doesn't, based on a bit of research) then I would take a reccommendation for software that is safe for download. This is one I've found in my research: https://www.sfml-dev.org/download/
but I am not sure it is safe for download

im on Mac Os
 

nsaspook

Joined Aug 27, 2009
16,271
SFML looks to be a valid software graphic library. Works for me in Debian Linux for a simple screen window demo. Don't know if it's really good.


1742673434262.png

1742673902978.png
The example Linux code has bugs on the web and github but that's easily fixed.

1742674866768.png

 
Last edited:

wayneh

Joined Sep 9, 2010
18,096
I would like to be able to make a bouncing ball simulation based on c++ code I've already written. Something where I can use code to simulate a bouncing ball in a graphical window.

I would like to do it in my web browser so I don't have to download anything, but if that doesn't exist (which I suspect it doesn't, based on a bit of research) then I would take a reccommendation for software that is safe for download. This is one I've found in my research: https://www.sfml-dev.org/download/
but I am not sure it is safe for download

im on Mac Os
You could use Xcode to build yourself a little app showing your bouncing ball. It'll be a bit steep learning curve to get started but once you're up and running you can do anything you can imagine. Even I have done some simple 2D animations.

That all said, I'm a little surprised you couldn't find javascript to bounce a ball around on a web page.
 

nsaspook

Joined Aug 27, 2009
16,271
Javascript is the way to go for Browser hosted animations.

Used this 3d Javascript library: https://threejs.org/
Threejs demos:
https://threejs.org/examples/#physics_rapier_instancing
https://threejs.org/examples/#webgl_camera_logarithmicdepthbuffer
https://threejs.org/examples/#webgl_effects_anaglyph
https://threejs.org/examples/#webgl_animation_keyframes

I wrote some simple (open frame) code years ago in threejs for Solar power indicators using a rotating cube.
https://github.com/nsaspook/mbmc/blob/master/TCPIP Demo App/WebPages2/dynvars_a.htm
 
Last edited:

Thread Starter

arduinolego611

Joined Jan 23, 2022
75
You could use Xcode to build yourself a little app showing your bouncing ball. It'll be a bit steep learning curve to get started but once you're up and running you can do anything you can imagine. Even I have done some simple 2D animations.

That all said, I'm a little surprised you couldn't find javascript to bounce a ball around on a web page.
Great I will try that. Not sure where to start but I thank you for the idea.
 

wayneh

Joined Sep 9, 2010
18,096
Great I will try that. Not sure where to start but I thank you for the idea.
If you're pursuing the Xcode approach, the first step is to download and install Xcode. You do NOT need to be a paid, subscribing developer to do that. If you wanted to share and/or sell your app, that's where you'd need to be a genuine developer but you don't need to pay for local playing around.

Incorporating C++ code into an Xcode app is quite doable - I've done it - but there are some hoops to jump through. Most of my projects are in Swift and dealing with C++ was a nuisance. Maybe it's not so bad if you're coming from there.

Once you have the software, find an online tutorial showing how to create a simple app. Build from there.
 
Last edited:
Top