Jump to content

Beginner: Is Babylon the right choice for interactive physics simulations?


kgj
 Share

Recommended Posts

Hi all,

I have been playing with Babylon in an attempt to create some browser-living simulations, e.g. "interactive permanent magnet electricity generator to help in the visualization of flux".

The syntactic feel, playground examples, and this community, everything has felt awesome. 

But, I have really struggled in (story to let you seniors have a sense of my level):

1. creating a 3D vector field (my grid-based euler-integral curve drawing algorithm was crashing the browser; got it partially working by copying starting points approach from here: https://github.com/matplotlib/matplotlib/blob/master/lib/matplotlib/streamplot.py

2. I am having trouble in creating a  simple fixed viewplane and fixed camera 2D view. (This is noob, but confidence denting, if I may say that)

 

So, my questions are:

1. Is Babylon the right tool to create educational content inspired physics simulations, and lightweight games (user interactions + scoring + webapp data bindings ) around it. Or, is it an overkill? Is something like p5.js more apt for my purpose?

2. Should I be using phaser for (strictly) 2D environments? If I should, would using Babylon and phaser hurt code (e.g. say having a single script file for air drag force )?

3. Is "Learning Babylon" book a right start (it's lagging in the version support)?

 

I am kind of lost in the jungle; please bear with me not being to the point. And I hope this forum will be kind enough as usual to point me to the right resources.

 

P.S. I am willing to pay for book/resources, if you have anything in mind. Also, I would prefer "getting in the run" asap, if that's possible.

 

Thank you all!

 

 

Link to comment
Share on other sites

Hi @kgj and welcome to the forum. Wow what a question. I am currently on mobile so my answer is limited. 

The first thing to consider is how important working in 3D to you? Question 2 suggests that 2D is the way you are generally thinking. If lots of your work is 3D with just some oppotunities to view in 3D then Babylonjs is the way to go. You could possibly use the orthographic camera without attaching it to the canvas for your fixed viewport.

If you generally want 2D views, even if 3D scenes, the something like phaser.

For a 3D vector field with unit vectors  (a, b, c) through points (x, y, z) which are the centres of a 3D cibes of size L then one possible way to show this is to extrude a circle along a line through (x, y, z) in the direction of (a, b ,c) scaling the size of the circle to give an arrow type thing http://doc.babylonjs.com/how_to/parametric_shapes#extruded-shapes

 

 

Link to comment
Share on other sites

Generally speaking:

1. I think so as long as you want something in 3D :) We are here to help btw 

2. Merging both can work but I think this is a bit overkill

3. It is a good read for a beginner and as we keep backward compatibility all code should still work

Link to comment
Share on other sites

@Deltakosh I know that you are the God :) Have so much admirations for your service, as well as community development. Thanks :) I hope to move to 3D mini-games and so I think Babylon should be it (until my ideas shoot themselves), and the journey would be much easier with you guys.

@johnk Thanks a lot for such an elaborated and kind reply. I think since I have to generally allow 360 views, to facilitate imagery, I will go with 3D in Babylon. And I sure will be working with those inputs on orthographic camera, and extruded shape. Thanks :)

 

P.S. I have started again with the introductory book "learning babylonjs", and it feels better. I hope my next questions would be more precise in the coming days!

Link to comment
Share on other sites

25 minutes ago, JohnK said:

A simple 3D vector field, very basic but gives you an idea of what can be achieved. Hope your learning is going well.

Hi John,

Did you miss to include any link to some field demo?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...