Popular Content

Showing content with the highest reputation since 05/24/2018 in all areas

  1. 11 points

    New GUI control: The Grid

    Hey guys!!! I'm glad to announce the availability of a new container for GUI: The grid Doc here: http://doc.babylonjs.com/how_to/gui#grid With this new tool, it's gonna be easier than ever to build complex UI
  2. 9 points

    More examples for PG

    Hey team! Did you see that ?
  3. 8 points

    Car Light Physics Engine

    Hi people, I'm currently investigating about some car games (car races in towns or on circuits or on mountain roads, etc). I know BJS can work great with some nice physics engine like Cannon, Oimo or Energy but I like to have lighter and more dedicated stuff when possible. That's why I took a look at this nice library : https://github.com/spacejack/carphysics2d There's a live demo here : http://www.spacejack.ca/projects/carphysics2d/ Use up and down arrow to push the gas throttle or the brake, the left and right arrow to steer the wheels and the space bar to pull the e-brake... drifting is so fun. Well, this is a light 2D library dedicated only to the car physics : you know, all the stuff about mass transfert on the wheel axis, acceleration, frictions, tire gripping, etc, etc. It's really light : the commented and un-compressed part of the code about the physics themselves is about 100 LOC only. So I just had a quick try to adjust it to work with a BJS example. This is not a real port, not even an adaptation in some BJS-esque style, just a plug to make it work with some 3D objects instead of 2D ones. Of course, I had to add some tiny logic to have 4 wheels rotating according to the current car speed. Here's a first quick and dirty proto : http://jerome.bousquie.fr/BJS/test/carSim1.html The car front is blue, the back is red. Up and Down arrow to speed up or to brake. Space bar to pull the e-brake. Just click once in the canvas before because the keyboard controls of the ArcRotateCamera have been disabled in order to be used as car controls instead. Note : the car can't drive backwards 😉 This could be proted, refactored in the BJS way and optimized then (added to my todo list).
  4. 7 points
    The Babylon field editor has gone into version 2.0 and is more stable. Many corrections, optimizations and improvements have been made. The interface has also undergone some small modifications with some patches. What you can do with the TerrainEditor : Create a new terrain with 5 sizes to choose from or load a recording. Rename or copy a loaded terrain or delete one. Create mountains or dig lakes, rivers. Smooth the terrain to soften your mountains or rivers. Raise trays rather than mountains. Paint up to 8 different diffuse textures for maximum terrain customization. (Thanks @Luaacro for the mixMaterial) Create ramps on the highlands or mountains to access your characters. Create holes in the ground to enter the basement, cellar / cellar ... Export the land in babylon format with all the textures used. An example file and html test is exported with. Export file meshes separate added in the terrain. Import and add meshes in the terrain Edit meshes with Inspector of properties Add water areas in the scene Add collision boxs in the terrain Add sound and music areas in the terrain Add portals in the terrain Each tool can be controlled to have more or less radius of your brush. You can choose the type of brush to have different shapes to paint textures. The brush is visible by a red allo on the floor following your mouse. Its radius defines what the brush will paint with precision. For texture paints, you can control the hardness and scale in addition to the radius of the brush. When raising mountains, you can control the maximum height limit of your mountains or the minimum limit if you dig. A grid allows you to see the sea level and is set to coordinate 0,0,0. This is useful when digging your rivers and lakes. You can save your work at any time and resume it on another day. When your field seems finished, you can export it for use in any project using the Babylon engine. Just take the hardware code of the export of the html file. I do not think that a publisher's documentation is necessary, but if you think you need it, leave me a message and I'll do one. But I think the editor is very easy to use. I hope this comprehensive field editor will help you. Do not hesitate to tell me if you have problems and tell me what you think, the improvements to make ... The publisher is open-source. You can download it on this repository The editor integrates a mini server to start it: https://bitbucket.org/JSbabylon/terraineditor/downloads/ Enjoy. Some screenshots:
  5. 5 points

    Problems with pivot and rotation

    Hi @ichbinrob as a simple minded man here is a simplified PG with simple code simply using TransformNode instead of setPivot. May not be exactly what you want but could give you some ideas or another approach. http://www.babylonjs-playground.com/#RIUM9U
  6. 4 points

    New GUI control: The Grid

    Example of a complex UI based on grids: https://www.babylonjs-playground.com/#WZZDNR#7
  7. 4 points


    As you can see on the issue, it is "in progress" Some demos for you: Scale http://playground.babylonjs.com/#7KX2R8#54 Axis drag http://playground.babylonjs.com/#7KX2R8#45 Rotation http://playground.babylonjs.com/#7KX2R8#53 Gumball/manager http://playground.babylonjs.com/#7KX2R8#61
  8. 4 points

    cloud : fill inside of mesh

    make points instance inside of box mesh https://www.babylonjs-playground.com/#L3PEXN#17 https://www.babylonjs-playground.com/#L3PEXN#18
  9. 4 points

    Babylon Toolkit Developer Portal

    Yo @Deltakosh and @Sebavan ... The first beta of the Babylon Toolkit Developer Portal (Also Available From Toolkit Menu: Developer Portal) website is now up. This site will be dedicated to babylon toolkit web game development. It is where i will HOST toolkit game projects, store developer files and training videos and maintain a Babylon Toolkit Developer Blog specifically for for toolkit features and demos. Check it out, tell me what you think
  10. 4 points
    For my projects I like Babylon for: No large IDE/libraries required, I can setup a local babylon dev environment in < 5min or jump into the playground instantly Easily reuse existing web stack, typescript, the dom, existing js code, npm, webpack, socketio, jquery, etc. No licensing
  11. 4 points

    Text as polygon mesh

    it works ! https://www.babylonjs-playground.com/#XWVXN9#22
  12. 3 points
    I've been working on Impossible Snake 2 for a while now and at this point I feel it's finished. You can play a 9 level preview demo in the link below. Impossible Snake 2 demo It is the sequel to Impossible Snake and it's a one-button snake game. You control the snake with only a single tap to change its direction, each time you tap the snake will toggle between turning clockwise and counter-clockwise. So in a way the controls are similar to Flappy Bird. Eat all apples to open the exit, go through the exit to complete the level. There are bonus coins in difficult to reach spots to add an extra challenge. There are some new features compared to the first Impossible Snake: Go through the exit to complete a level Collect bonus coins for an extra challenge Moving spark enemies, avoid them or you'll get electrocuted Laser beams, some can be switched on and off 27 levels + 9 bonus levels 3 different background themes Some sound & graphics tweaks Btw looking back I don't know why I didn't include screen shake in the previous game, as it's simply built into Phaser. It was just adding one line of code but it gives that much more *oomph* when you hit a wall. 😆 Anyway let me know what you think of the game.
  13. 3 points

    Tilemap & File Pack Project Template

    I've created a template to illustrate the concept of levels generated from dynamically loaded tilemaps from a single level scene. Phaser 3 Tilemap & File Pack Project Template Demo Questions and feedback are welcome!
  14. 3 points


    Hi everyone, Been away for a while but I've kept practicing with Babylon. This is at a prototype phase with no 3d/sound/artwork. Just pure javascript code for now. Trying to get the mechanics working properly first. One question I have is how the projectile rotationQuaternion is cloned. It seems to follow the lookAt() quaternion from the origin tower even after the quaternion is cloned. How can I ensure that the rotationQuaternion is not linked to the original quaternion it is taken from? This causes problems when a tower shoots a projectile and then rotates to target another enemy. The previously mentioned projectile rotates in midair still copying the rotation of the tower. Here's the relevant code taken from line 53 of https://github.com/xtreemze/defend/blob/master/src/js/main/projectiles.ts const clonedRotation = originMesh.rotationQuaternion.clone(); clonedRotation.normalize(); projectile.rotationQuaternion.copyFrom(clonedRotation); Comments, questions are welcome! The project is hosted here with open source: https://github.com/xtreemze/defend View the project here: https://xtreemze.github.io/defend
  15. 3 points

    Apple deprecates openGL

    I've seen some people answering (can't remember where on Twitter), it won't impact WebGL which makes senses. You can implement WebGL on top of Metal. In previous versions of Edge, our WebGL implementation was directly on top of DirectX, no OpenGL at all. We're now relying on ANGLE which is a wrapper on top of OpenGL and DirectX. Again, on PC, WebGL is directly bind to DirectX. I'm then not worried about WebGL support. If they're changing the implementation, they will probably have some bugs we will have to take care as 3D engine makers.
  16. 3 points

    Car Light Physics Engine

    yep, the best Cx ever (and colors also)
  17. 3 points

    Unable to get mesh on click event

    Hi @Varsha Kamble I became far too interested in how to go about implementing this, and ended up making an improved pg based on your one above: https://www.babylonjs-playground.com/#Q2QLYZ#4 I changed the dragging implementation to use mathematical planes as projection targets (as opposed to just mesh picking). This has the advantage of not needing the pointer to always be above a mesh when dragging, and also means that all three axis should get a nice 1:1 mouse movement to screen movement in the given axis direction. Hope the above is useful and/or interesting to someone.
  18. 3 points

    OfficeGames project

    About the SceneManager, it's for now a really light tool like this : SF.SceneManager = function() { this.scenes = {}; // scene objects storage this.sceneNb = 0; this.currentScene = undefined; }; SF.SceneManager.prototype.addScene = function(name, scene) { this.scenes[name] = scene; if (this.sceneNb == 0) { this.currentScene = scene; } scene.setSceneManager(this); this.sceneNb++; }; SF.SceneManager.prototype.removeScene = function(name) { this.scene[name] = null; this.sceneNb--; if (this.sceneNb < 0) { this.sceneNb = 0; this.currentScene = null; } } SF.SceneManager.prototype.renderCurrentScene = function() { this.currentScene.render(); }; // Scene orchestration SF.SceneManager.prototype.notify = function(messageObject) { // put your own logic or scene orchestration here } And it's initialized like this : var sceneManager = new game.SceneManager(); // assuming you created some BJS scenes before, add them to the manager sceneManager.addScene("game", BJSGameScene); sceneManager.addScene("levelTextScreen", BJSLevelScene); // start the first scene var startScene = sceneManager.scenes["levelTextScreen"]; sceneManager.currentScene = startScene; // render the current scene in the render loop engine.runRenderLoop(function(){ sceneManager.renderCurrentScene(); }); Then you only need to add a finish condition in each of your scenes : the scene simply notifies the manager with some message object of your own (note the scene can notify the manager even when it's not finished, just to pass some message). // in the scene logic, at some moment // message to be passed to the manager for example var that = this; this.notificationMsg = { level: that.level, emitterName: "level", message: "completed", emitter: that }; // notification to the manager of this scene // note that the legacy Scene Object has been extended by the property "sceneManager" this.sceneManager.notify(this.notificationMsg); And just add the scene orchestration in the method notify() of the SceneManager : if the emitterName of the message is this scene and the message is, say, "over" or "completed", then switch the current scene to the GAME OVER or next level screen for instance
  19. 3 points

    OfficeGames project

    back For some personal reasons this project was delayed for while, but now I'm back again (slowly) on it. FYI : Although not many things have changed in the first and only current game, I refactored a bit the code and implemented an early prototype of a SceneManager, a light tool to switch from a BJS scene to another one according to some logic. Maybe when the tool is working fine and stable, I will propose it for a PR in the core or at least as an extension. FYI also : I disabled the user FPS log in the database. just click to start a new level : http://officegames.eu/StarFighter/StarFighter.html ... the program still remains far from achievement
  20. 3 points

    The Wingnut Chronicles

    https://www.babylonjs-playground.com/#KZ928Y#3 its a little glitchy on the tac line length, and I have not added numbers yet.... but yeah here is a start. Im sure there is a better way to clip out the ticks on the bottom as well then what I did, but referencing its polar coords vs mixing it out.
  21. 3 points
    Hello Varsha! We are currently working on officially supporting gizmos (manipulators) in 3.3: https://github.com/BabylonJS/Babylon.js/issues/4141 We should be good in a week or two
  22. 2 points

    The Democracy Times - game prototype

    Hi! I want to share with you the last game I made using Phaser3 https://gamejolt.com/games/democracyTimes/340850 You work as an editor-in-chief of a newspaper that is threatened by outside forces. They want to censor your content and you have to decide whether to let yourself be intimidated or to bear the consequences for your actions. To animate you to replay, the game has a total of nine different endings The game is opensource, check the code on: https://github.com/agar3s/TheDemocracyTimes
  23. 2 points

    What's next?

    🏆 The bird likes to learn. Asks boss, says "later". : )
  24. 2 points

    Lamps on Babylon / Open Contest!

    I gave up using baked light / AO maps on a recent project as the customer wanted bits of the scene to move. Not that it's very helpful to the OP, but when processors get fast enough.. this is that kind of thing that would be great to have for realtime realistic scenes: https://erichlof.github.io/THREE.js-PathTracing-Renderer/
  25. 2 points
    Yo @HeadClot this is now natively supported by Toolkit ... check out the docs https://doc.babylonjs.com/resources/10_windowsplatform