eee-c Posted February 24, 2017 Share Posted February 24, 2017 Howdy! This might be a bit too much brain dump for a forum, but here goes... By way of background, I'm the author of 3D Game Programming for Kids. I've been evaluating Babylon (and others) as I prep for an updated edition. The book first came out at the end of 2013 when Three.js was pretty much the only game in town. It's fun seeing what's available in 2017. And Babylon is among my happy discoveries. That said, I've got some questions / feedback -- and am especially curious if others use Babylon to teach. I totally get that Babylon isn't a teaching library. So feel free to ignore some / all of this.. First up, I really appreciate the beauty of the resulting animations that I get with Babylon. Even with simple shapes (e.g. those in an intro chapter), things are pretty and don't require much fiddling with lights and cameras. The various support handlers (resizing) are unobtrusive and work solidly. And the integrated physics is a joy. I seriously love working with that stuff. That said... The API kinda bugs me (and I say that with due love!)... One of the things that I try to do in the book is keep the typing to a minimum. It's aimed at kids -- motivated kids -- but kids nonetheless. The more typing, the higher the likelihood of errors. The more that code requires switching between all caps, and camelcase, the more likelihood of coding errors. The more namespace depth, the higher the likelihood of errors. The same goes for the number of arguments in constructors and methods. As well as the different kinds of arguments (strings, numbers, objects, and attribute objects -- curly braces can be daunting!). In addition to a lot of typing, needing to label every mesh and supply every mesh with a scene object is burdensome without providing much conceptual relevancy. That is, I have to teach kids / adults to include them all the time even though names aren't used much -- at least not when introducing concepts. Mostly, I wonder why createSphere can't auto-assign the name "sphereN" when the first argument isn't a string. My understanding is that the scene argument helps with memory management, which is cool -- it seems to work. That said, I wouldn't mind the option of being able to tell the scene to add a mesh instead of creating a mesh for the scene. And really, I'd like fewer arguments for my own sanity in addition to teaching. So I'm curious if anyone deals with teaching or has suggestions for how to deal with these things. I've thought about writing a simple wrapper that flattens some of the namespace, auto-assigns a label, and simplifies the MeshBuilder create methods. Maybe something that creates a sphere even when no arguments are supplied, creates a sphere with diameter when the first argument is a number, or creates a sphere with named attributes when the last argument is an object literal. But of course, that's work for me (shudder). Plus the older kids / adults that want to start "real" Babylon coding will be at a disadvantage. Along those lines, I understand why MeshBuilder creates the shape and material at the same time. Still, I appreciate Threejs' separation when teaching -- create a geometry, create a material, create a mesh by combining the two. I understand that Babylon is meant for professionals to be productive, but it'd be super nice to have access to low-level concepts for teaching (and maybe coding at times). It'd also be nice to have a set() method on Vector3 to be able to update all three at the same time instead of using the "inPlace" methods. One last thing is the left-handed coordinate system. Kids just aren't exposed to that in my experience. I'm grateful for the useRightHandedSystem property even if it'd be preferable not to expose it at all. I would only suggest that it's not explicit and easy to overlook for folks first coming to Babylon. Anyhow, thanks for the great framework. Really! Despite the above, I definitely anticipate using it -- even if not in the book. And thanks for providing this forum as a place to brain dump like this! -Chris Quote Link to comment Share on other sites More sharing options...
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.