• Content Count

  • Joined

  • Last visited

  • Days Won


Everything posted by satguru

  1. nice pg @waverider I am trying to use Dynamic terrain with my Character Controller. Here I have an ArcRotateCamera following a Character. If i turn on checkCollosion on the camera, the FPS drops to 21-25. If I turn it off, FPS goes back up to 60, Weird. The camera does not collide with anything. It just follows the character. The character has collision turned on. You would think collision on the character would make a difference. After all it is the character which is colliding with the terrain But no. It is collision on camera which makes the difference!!
  2. @jerome I took your original document example and turned on collision and gravity When you move the camera around the fps drops from 60 to around 30 Is there anything which we can do to prevent this? Also camera tends to get stuck from time to time.
  3. @jerome issue with BABYLON.MeshBuilder.CreateRibbon ? this example without CreateRibbon works fine
  4. I suspect something to do with arcrotate camera ? There is a delay between start of mouse move and the camera movement. Once the camera starts moving the scene is responsive. The moment I stop moving the mouse and then start moving it again there is a big lag before the camera starts moving again The lag is more on chrome less on firefox
  5. @jerome I am checking out the examples at most of them are unresponsive/low fsp see this first example from that doc
  6. @dbawel Here is one way you can do this Instead of creating a scene using BABYLON.SceneLoader.Load() function Create the scene using var scene = new BABYLON.Scene(engine); Then load your .babylon file using BABYLON.SceneLoader.Append() function Here's some pseudo code ========================= var scene = new BABYLON.Scene(engine); //add camera, light etc ..... //run loop here or from within SceneLoader.append() engine.runRenderLoop(function() { scene.render(); }); var mesh_prop; BABYLON.SceneLoader.Append("", "baloon.babylon", scene, function () { mesh_prop=....; //register here or outside this function scene.registerBeforeRender(function () { mesh_prop.rotate(BABYLON.Axis.Y, Math.PI / 64, BABYLON.Space.LOCAL); }); }); scene.registerBeforeRender(function () { if (mesh_prop) { mesh_prop.rotate(BABYLON.Axis.Y, Math.PI / 64, BABYLON.Space.LOCAL); } }); ================================
  7. @dbawel if you check the browser console you will see the following error Uncaught TypeError: Cannot read property 'registerBeforeRender' of undefined at createScene (index8.html:92) at index8.html:102 maybe you need to move scene.registerBeforeRender(function () after line var scene = createScene(); scene loader function is async.
  8. new release Release 3.0.0 (12/31/2017) major change to rotation UI now uses the more common "spherical" guides new methods getPosition() getRotationQuaternion() hide() show() isHidden() setVisibility() few properties and methods which were private were exposed by mistake. They are now hidden code refactoring. demo
  9. Wishing you and everybody else a very happy merry Christmas
  10. @Dad72 Thanks for reporting the setTransSnap bug. I have fixed it. Let me know of improvements you made. I will try to add them to my version.
  11. @Dad72 Ok. As an aside, I had thought of adding this as an extension but I am too lazy and work too much in fits and starts to be able to properly support it as such.
  12. @Dad72 clone and instance works for me. See this playground example I copied pasted the the latest edit-control code from
  13. @Dad72 can you reproduce in playground?
  14. Yes , makes perfect sense. Lots of good information here. I need some clarification on includedOnlyMeshes and shadows, but let me open a new topic for that. Do not want to hijack @kurhlaa 's topic
  15. @Deltakosh Ahh.. didn't realize I had to add ground too. BUT still see an issue Even though other boxes are not added to "light2" their shadow is still effected by it. If I change the intensity of "light2" the shadows of all boxes changes. How come? see line 19 and 20 in
  16. @Deltakosh , Thanks. That helps a lot. Ran into another issue. This has to do with includedOnlyMeshes and shadows. I thought - lets create two lights and two shadowmaps. One light and it's shadow map for all static meshes and the second light and it's shadowmap for just the dynamic mesh. The first one is rendered only once and the second one every frame So I took @kurhlaa example and modified it as follows 1) added another light - light2 2) created two shadowgenerators, one for each light 3) Added all mesh except the last one to the first shadow generator and the last one to the second shadowgenerator 4) added last box to light2's includedOnlyMeshes problem - last box does not cast any shadow!! see
  17. @Deltakosh 1) So a quick optimization would be to remove all those meshes which are not being viewed by camera from the shadowmap. Is there quick way to find if a mesh is in the camera view? 2)how do I create mutiple shadowmaps? I created two shadow generator for the same light but only the last one seems to be effective. 3) I see a class called ShadowLight. What is this?
  18. @FunFetched I have struggled with this issue too . I would love to hear more about your techniques. @Deltakosh if an object is in the renderlist but is not in the camera view does it still take up shadowmap resources?. Also is there anyway to "bake" shadows?. If i know that my light and object position isn't going to change is it possible to "freeze" the shadow, prevent it from being recomputed every frame?
  19. @jerome ahh.. makes sense, thx @JohnK we do have great documentation, don't we !! Working on a mesh/terrain editor. here some work in progress
  20. In this playground I create a cube then get its vertices data When I get the vertices data using box.getVerticesData(BABYLON.VertexBuffer.PositionKind); I get an array containing 72 elements How come? A cube has 8 vertices Shouldn't the array have only 8*3 = 24 elements ? Same thing with NormalKind. I get an array with 72 elements!
  21. @RelativeNull Currently the controller would not interact with other physic bodies. If instead of moveWithCollision(), had I used move with force or impulse then that would have worked. With the current approach one would have to capture a collision event and apply some force. I will continue looking into it.
  22. @RelativeNull This is not based on physics engine. I have updated the document to reflect this. Here is what it says now. It uses the collider and moveWithCollision() function to move the character around. It uses some of the physics kinematic equations to calculate movements like jump, fall, slide. It does not use any physics engine. It does not react to or apply forces. The unityt3d document nicely explains why physics engine may not be ideal for this
  23. @Dad72 I think I see your concern. Maybe instead of setWalkAnim() or setWalkBackAnim() I should call it setForwardAnim() , setBackAnim() and so on. This way they would make sense for walk, fly, swim etc. setAnims() and passing an anim array makes sense too. With this the name doesn't matter. 1st is for going forward, 2nd for going back and so on. I will add that . I like separate methods because in an IDE auto complete and type assist guides you and helps you discover various functionalities. I am also thinking of adding a pauseAnim() and a resumeAnim(). This will allow user to play any animation while the CharacterController continues controlling the movement.
  24. @RelativeNull, Thanks @Dad72, I do not understand the need for addAnim(). The user can add any animation to the avatar/player skeleton. The CharacterController will only use the one it needs and ignore the rest.. As far as default animations are concerned the user can call them whatever they want. If the name is different from the default animation name they can use the setWalkAnim(), setRunAnim() and so on to map them to the default animation. Example to map "myWalk" animation to Walk animation -> setWalkAnim("myWalk",1,true);