• Content Count

  • Joined

  • Last visited

About Metalx1000

  • Rank

Contact Methods

  • Website URL
  • Twitter

Profile Information

  • Gender

Recent Profile Visitors

1490 profile views
  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.