• Content Count

  • Joined

  • Last visited

Everything posted by Metalx1000

  1. I noticed this yesterday and figured it would get fixed, but looked again today and noticed it's still broke. Github shows the examples project was updated 3 days ago. I'm guessing that's when it happened.
  2. I'm using ThreeJS and I've created a basic scene in which I've imported some objects from a dae file. Everything is going great except when I try to apply a basic box body to an imported mesh with CannonJS. If I create a cube with code and apply Physics to it, it works fine. But, if I try and added Physics to an imported model it seems that the bound box shape for the Physics is to big (I'm guessing that's what it happening). Here is the scene: You will see that the smaller boxes and the large ground box, seem to work just fine. But, the larger box seems to be floating. I've set it to flip every 2 seconds just so you can see how it's moving. The function I've put together this function to apply the physics. (I'm guessing that this is where the problem is) function addBoxPhy(obj){ var mesh = obj.children[0]; if(mesh.type == "Mesh"){ var halfExtents = new CANNON.Vec3(.5,.5,.5); var boxShape = new CANNON.Box(halfExtents); var boxBody = new CANNON.Body({ mass: 5 }); boxBody.addShape(boxShape); world.add(boxBody); boxBody.position.copy(mesh.position); boxMeshes.push(mesh); boxes.push(boxBody); daeBox = boxBody; } }I've been trying to figure this out for a day or two now. Any help would be great. Thanks
  3. This is what I've been working on in my spare time over the last week. Still a lot to do, but it's playable. Starts pretty easy, but escalates pretty quickly. Unlimited lives, and it's a never ending game, but currently only 3 bosses (new boss every 100 kills). I think some devices might have trouble going full screen (example: iPhone). Mouse play on Desktop, but works really well with a touch screen in portrait mode. Any input or help is welcome. Playable here ("stable"): Unstable here (updated every hour) Source code here: [screen Shot]
  4. reddozen, You are correct, distance over time.
  5. dad72, Thanks for the advise. I haven't really learned how to use Octree yet. I've read about it, and I think I understand the basic concept, but I haven't used it in code yet. I know Octree can be use for collision detection, but I'm guessing it can improve performance in other ways since in this since the only collisions would be between the camera and the ground. The line you gave : if(scene._activeMeshes.length > 100) scene.createOrUpdateSelectionOctree();I'm guessing that that checks if there are more then 100 meshes visible to the camera and if so use Octree. I'm assuming this has to be checked regularly, so do I put it in the render loop? If so I just tried that and it made no difference. If it goes somewhere else, or only needs to be called once, please let me know. Although it seems like Octree is important and something I need to learn to improve performance of my project, I also feel like even if this did help, it would be more of a work around then a fix. Because, even if I improve performance, there will still be times where the game might still run slow, and if it does, it shouldn't effect the game like this. Is there any way to make gravity work on a time base rather then a render rate? I'm sure I could hack something together, I'm just hoping that there is already something that I can use rather then create something. In my head, the way I would do it would be based on a time interval and it would move the camera down a certain amount based on time. So, if anyone knows of a way that this is already done, please let me know. Other wise I might start working on throwing something together myself. Which will probably be ugly and I will spend forever tweaking it
  6. So I've been working on a game (First Person Shooter): One of the problems I have now is with the gravity. In stead of having people look through the mess of the code for that project, I've simplified it here: That scene might take a minute to load. It creates 3,000 random spheres in the scene. You can make the camera jump by clicking the mouse. The problem is this. When the scene gets complicated, and the frame rate drops, gravity slows down. So, in this example scene with the 3,000 spheres I get 60fps in chrome on my desktop. When I jump, it lasts less then a second with my current settings. But, on my laptop (or in a browser that renders slower - example: Firefox) were I get 20fps in that scene, the jump lasts about 4 seconds. This becomes a real problem in my game because on slower machines you can fly across the board with one jump, If I change the settings and adjust them for slower computers, then on faster computers the jump time is to short. Is there a better way of doing this? Thanks for any help.
  7. binyan, I'm not 100% sure what you are trying to do, but I think I might. This may not be the best solution, but is this the sort of thing you are trying to do?
  8. Thanks gryff, The Bake Animation option was what I needed. Thanks for the post.
  9. This is a pretty good solution, It's a lot simpler then some of the things I have come up with. I'm just not really sure why you posted this here and not as a response to my question. Might have saved me some time if you had at lest posted a reply saying, "Hey, I have an answer in this thread here." Anyway, I'm still having a problem. Creating a path this way creates key frames for the path, not the Cube. Obviously it works, you did it. So, I must be doing something wrong. I must have skipped a step. I can Follow the Path in Blender, but not in BabylonJS because the Cube doesn't have key frames. How did you apply the key frames to the cube? Thanks.
  10. thanks Kostar111 I'll play around with that.
  11. Deltakosh, good to hear. Kilombo, thanks for the help. I'll play around with this.
  12. Kilombo, So what you are saying is that there is currently no function in Babylonjs (as far as you know) that does this and if I want to do it I'll have to write my own function. Is that correct?
  13. So I wrote this little script that has a Cube move from one empty to another to make it's way through a maze to another Cube. My question is, Can a get an object to follow a path/curve? I've tried Googling "babylonjs follow path", but didn't find anything. Is this possible at this point? Am I using the wrong wording in my searching? Thanks for any help.
  14. I'm currently working on a game, Playable here: Code Here: Right now I'm using intersectsMesh to check for collisions. I have two questions. 1) Is there a better way to do this? 2) Can you check if an object intersects another without having to check them all? Here is my current code for enemy collisions. for(var i=0;i<Obstacles.length;i++){ var obs = Obstacles[i]; //console.log( + " is " + this.mesh.intersectsMesh(wall)); var col = this.check_collision(obs); if(col){break;} }Every time an enemy is updated/moves, I check it against ever object in the "Obstacles" array (which is an array with all meshes that are obstacles for enemies). I use the Obstacles array, that I created, so that I don't have to check every mesh in the scene, but it still seems like there should be a better way, because this is a lot of checking over and over again. I'm hoping there is a way to have it check if it's intersecting anything and then just check what that object is and if it's in the Obstacles array. Early on I tried using Cannon.js for this, but I had issues. Things like, if I apply physics to a wall, and that wall touched another wall, they would fly apart and hit other walls, and basically destroy the level. Also having a bunch of meshes with physics really slowed down the performance. But, maybe I'm just using it wrong. Thanks in advance for any help.
  15. Thank you Deltakosh, that was exactly it. I really should have thought of that. I think in my head I was picturing a box with depth to it surounding the plane when I applied the "BoxImpostor". Thank you so much for your quick response.
  16. **Solved! **cannon.js does not like 0 height object. I suggest you to use a box with scaling.y = 0.01 instead of a plane for your ground **Code has been updated Does anyone have a clone why these meshes are sometime falling through the ground plane and other times they are not? Do is have to do with my "setPhysicsState" settings or something else? Thanks in advance for any help.
  17. I've posted some 3D renders of the test level in Blender 3D
  18. timeinvariance, Game looks nice. Menus look great. Filters look good. Models look good (I like the Cacodemon/Pacman looking monsters). I got about 15 fps in Iceweasel/Firefox on Linux on my desktop (2fps on my laptop) But in Chromium on my desktop in Linux I was getting 50fps to 60fps. Then I tried the game I've been working in Chromium, and it ran so much better that the timing of stuff was off and now I'm working on fixing that I really like the style of your game. At first it was really hard, but then I found the shotgun and things got easier I can't wait to see more of these as you make it.
  19. I've added a lot the last few days. SkyCube, Enemies that attack you. Both heat seeking and regular missles for the enemies to attack you with (not modeled yet, just white spheres for now). You can play the lastest version here (there might/will be bugs and glitches): And you can get the code here: You can catch me on freenode if you want to talk (I go by Metalx1000):
  20. timeinvariant, Thanks for your input. I'm mainly testing it in Firefox(Iceweasel) on Linux. I did try it on a Windows 7 machine in Firefox the other day and I also experiacnce the lack of the sprite explosions. I thought maybe the image didn't load properly and was cached that way and I didn't have time to look into it then. I'm glad you were able to test it for me, and it's interesting that you didn't have the issue with Firefox and I did. I don't remember what version of Firefox I was running, but I had just done an upgrade on it before testing, so it should have been the newest version. I'll have to look into zipping the files up for download. It's something I haven't looked into yet. Thanks again for your input.
  21. About a month ago I started working on a First Person Shooter using ThreeJS. The main Goal is to make it easy to design a level/map/game in Blender 3D and have it fully functional in the browser without having the designer touch any of the code (although it is encuraged to look at, play, and help with the code). After about 2 weeks of working on it, I through out everything I had and started over again with BabylonJS. The game is coming along well and I thought it was about time I started sharing, and looking for help. To be honest, my coding is a mess and I'm constantly re-writing things. I really hope that people join in and help me with this project. I definately need some help making the menus and Heads Up Display look nice (anyone good with CSS?), as well as help with everything else. Here is a little bit of the game play: You can play the lastest version here (there might/will be bugs and glitches): And you can get the code here: You can catch me on freenode if you want to talk (I go by Metalx1000):