Cone.js – my first steps on BabylonJS

babylonjs-first-steps-cone

It’s been a while since I wanted to try BabylonJS, but as all of you, I had some projects on the run that I wanted to finish AND release ;).

So finally, two months ago, I took the time to start a little project, only to discover the framework, with the usual tutorials like creating spheres, cubes, adding lights and camera. I even installed blender to do some 3d modelling in order to get an export (nothing extraordinary – it’s a pity, I used to be good at that, but it was ten years ago on 3dsMax …).

After the tutorials, I needed an idea to start with. About two years ago, I made a little ThreeJS project presenting one of the roller skating slalom cones I used to draw on my comic strips.

I started the project without any clue of where I was heading (the goal was to discover BabylonJS), I had in mind to make some kind of game out of it, but that was all …

I ended up making Cone.js, a class that lets you manage those 3d cones I told you about, but I did much more than I thought at the beginning :

  • extension possibilities of the Class (like the jQuery.fn)
  • methods not only available on cone instances but also on cone lists
  • animation queue management (even custom user queues)
  • tried both jsdoc and yuidoc documention generators (finally kept yuidoc)

TRY IT

Conclusion

If you have a little game development background (you’re used to manage things like render loop / user inputs), you can start making simple scenes with BabylonJS very quickly (especially with user interactions with your objects). However, if you don’t have any 3d background, I think the modelling / texturing part (that you make it by code or in softwares like blender) may be difficult.

As you will see, my 3d models are coded in JavaScript (not exports), even for that, I’m glad I remember the problems I encountered when I did 3d modelling, like grouping objects, pivots, textures … But I’m sure a 3d graphics designer would do a much much better job and most of all, that would take advantage of some of the best assets of BabylonJS : the ease of importing 3d objects exports and creating your own shaders …

One thing I was a little disapointed of : the physics engine. At the moment I write those lines, there are only two types of impostors : Box and Sphere (not counting the Compound), so if you have a cylinder or a complexe mesh, you can’t benefit of the built-in BabylonJS physics engine. But don’t shy away, this matter is taken in account as well by the BabylonJS team as by the community (I think someone is already porting ammo.js).

I’d like to finish this post by thanking the BabylonJS team who is there on twitter to answer very quickly to any questions.

Tophe

PS : Next step : I’ll add some particules effects (I haven’t played with that yet).

3 thoughts on “Cone.js – my first steps on BabylonJS

  1. It’s hard to find your page in google. I found it on 17 spot, you should build quality
    backlinks , it will help you to get more visitors. I know how to help you, just search in google – k2 seo tips and tricks

  2. I read a lot of interesting content here. Probably you spend a lot of time writing,
    i know how to save you a lot of time, there is
    an online tool that creates readable, SEO friendly articles
    in seconds, just search in google – laranitas free content source

Leave a Reply

Your email address will not be published. Required fields are marked *