DellaFree

Members
  • Content Count

    54
  • Joined

  • Last visited

  • Days Won

    2

DellaFree last won the day on August 10 2015

DellaFree had the most liked content!

About DellaFree

  • Rank
    Advanced Member

Profile Information

  • Gender
    Male

Recent Profile Visitors

754 profile views
  1. Hi everybody, I made this simple playground : http://www.babylonjs-playground.com/#17QEYE#5 I would like to know if it's possible to create the same effect without using the physics engine. The idea is that the bullets are shot in the same direction, where the sphere is moving. Any ideas? Thanks a lot, cheers, DellaFree
  2. Hi everybody, I'm back after more or less one year :D. I 've been very busy with a lots of universiy exams, but now I have some time, so I've decided to made this simple real-time multiplayer game. Here is the code : Real-time-multiplayer-game-with-BabylonJS-and-socket.io Wht do you think about that? In your opinion, the logic behind the creation of the meshes is correct? This not the best game ever , but it is just an experiment and a way to learn how socket.io and BabylonJs can work togheter. Thanks a lot for all the previous support. Cheers, DellaFree p.s. It's my first project on github, so feel free to correct and modify whatever you want
  3. Oh great! I have no thought about that XD sorry for the stupid question. Many thanks !!!!
  4. Hi guys I would ask you a question: is there a way to update some value of mesh (i.e a ground) without stop the engine and restart again? I try to explain better : I use this peace of code $('#mapHeight').slider({ value: 0, min: 50, max: 200, slide: function (event, ui) { MAP_HEIGHT = ui.value; engine.stopRenderLoop(); startBabylon(); } });I set the global variable MAP_HEIGHT; it is used in this function : var ground = BABYLON.Mesh.CreateGroundFromHeightMap("ground", 'texture/heightMap.png', 800, 800, 100, 0, MAP_HEIGHT, scene, false, null);Then I stop the renderLoop (the variable engine is global) and call the function that start all the scene (startBabylon(); ). In this way when the scene is created, I will use the vaue updated. It works, but every time I change the value with the slider, I stop the engine and start again , but ,for a fraction of second, I notice that the scene is loading (with a grey screen); so I would know if there is a way to update this value without stop the engine and make it more "fluid". Or there is another way to do this? Many thanks guys !
  5. Hi davrous ! I was going crazy finding where is the problem Many thanks for the anwser and for the tips ! Cheers.
  6. Hi guys! I open another topic instead continue on the other. This is my situation : I have this simple PG : http://www.babylonjs-playground.com/#1PTVTW#12 (an old PG). I download the scene, add a folder in which I put the heightMap.png, change the path of the heigthMap ( folder/heighMap.png on file index.html ), and run on IE. All works fine Now I try to create a project with Visual Studio. So the steps I made , are: file-->open web site-->the project folder -->open. Then I run normally selecting IE as brower, but in this case it doesn not work properly (the FPS is more or less 10-12). Instead in all other browers (Firefox, Chrome, Opera) it works. Am I missing something ? Is it only my problem? Many thanks guys. I'm going crazy finding where is the problem XD
  7. Hi guys! Sorry for my absence, but I have to study other subjects But now I'm come back to babylon I try to find a solution for the previous probem and for what concern the error related to the animation, I "resolved" removing the previous peace of code and replace with this line scene.beginAnimation(ship, 0, (Math.floor(Math.random() * (speedShips - 100 + 1)) + 100), true);so the ships have different speed and the effect it's similar. But I have not solved the problem related to IE and I don't know how to show you the problem. The same scene works fine on Firefox ,chrome and opera, but on IE it has a very low FPS (more or less 10). Have any idea on how I can show you this problem? I tried to downlod the scene, but I failed. Also I notice that removing the heightmap all works fine even in IE. Edit: I make a little progress finding the solution. The peace of code that cause the low FPS on IE is this : ships.forEach(function (ship) { var shipLookout = ship.position.clone(); shipLookout.y = 7; var direction = ground.position.subtract(shipLookout); var offset = direction.clone().normalize().scale(5); var rayOrigin = shipLookout.add(offset); var ray = new BABYLON.Ray(rayOrigin, direction); var pickResult = scene.pickWithRay(ray); if (pickResult.hit && pickResult.pickedMesh == ground) { if (pickResult.distance <= 50) { var animatable = scene.getAnimatableByTarget(ship); if (animatable) { animatable.stop(); shootBullet(ship, tower, scene); } } else { //do nothing } } });I tried to find the "problem" (I don know if it's really this the problem) commenting the line one by one...and try to comment these line the scene does not has low FPS: var pickResult = scene.pickWithRay(ray); if (pickResult.hit && pickResult.pickedMesh == ground) { if (pickResult.distance <= 50) { var animatable = scene.getAnimatableByTarget(ship); if (animatable) { animatable.stop(); shootBullet(ship, tower, scene); } } else { //do nothing } }But in this way the ships don't stop when they reach the island. Before, removing the heigthMap, I don't have this problem, because the ground don not exist, so the problem is not the heightMap but this peace of code (only on IE). So, at this point, have any idea on how to fix my problem? Many thanks guys, and sorry for the amount of questions p.s I opened another topic.
  8. I also noticed that removing the height map, all works fine in Explorer. But when I add it again, Chrome and Firefox not problem (55-60 FPS), instead Explorer has about 10 FPS It's the same scene. It's really strange. I'm forgetting something?
  9. Great many thanks RaanaW Really you helped me a lot !!! I'm testing again and again this scene, but not on the playground just locally and I noticed that on Chrome and Firefox there is no problem, but using Explorer the scene crashes a lot (more or less 10 Fps , instead chrome and firefox about 55-60).; also on exporer I get an error like this ''Uncaught TypeError: Cannot read property 'animations' of undefined", instead on firefox I get this error "t is not definied". I think that the problem is related to this peace of code : function startAnimationWithDelay(k) { setTimeout(function () { scene.beginAnimation(ships[k], 0, speedShips, true); }, Math.floor(Math.random() * 5000)); k++; if (k < ships.length) { startAnimationWithDelay(k); } } //startAnimationWithDelay(0); //using 0 one ship does not move startAnimationWithDelay(-1); I'm trying to download the scen from the PG to test and find out what is the problem , but I encountered some problems with the get .zip" function : ( Yes today is the day of problems . Any idea on what it could be the causes of this? Many thanks again guys
  10. Hi everybody !! I 'm trying to add some more features, and in particular I would add some multi materials to the island; here what I've done (only island): http://www.babylonjs-playground.com/#2JBXHX . I read the various tutorials (for example : http://blogs.msdn.com/b/eternalcoding/archive/2013/07/10/babylon-js-using-multi-materials.aspx) but when I call the function ground.getTotalVertices(); the result is 0. Any idea on why this happens?
  11. Hi Thanks Temechon !! This is the updated version : http://www.babylonjs-playground.com/#6FFQW#35 . Now I understand where I was wrong Again any thanks
  12. Hi everybody Thanks iiceman for the suggest ! I change a little the scene : I've remove the water because the PG is too big and I can't save, substituted the ships with some purple tunks and added sprites effect (very simple) when an element is destroyed. Here what I've done : http://www.babylonjs-playground.com/#6FFQW#31 but I'm not able to fix the minimap yet I followed the varius tutorial (the code is the same), but nothing. Also I notice that sometimes, opening the console, I get the error : "t is undefined". Because there are many things to load, is there a way to start the scene only when all is loaded ? Many thanks guys. cheers
  13. Yes it could be interesting, but I can't open your link Edit: Great it works Wow it' simply amazing
  14. Yes, it should show the enemies and all the map (island, tower, dude ) . Yes it seem to be turn upside down XD