dhiru

Members
  • Content Count

    24
  • Joined

  • Last visited

  1. dhiru

    moveWithCollision issue -- quirks

    Many thanks for this; I feel sorry I could not find this on my own (not being lazy, just stupid), I actually tried to look at the logs could not spot it; please feel free to advise how you got it!. Thanks again.
  2. dhiru

    moveWithCollision issue -- quirks

    I simplified my code in order to highlight the issue (I was hoping it will automatically solve it -- but I am able to reproduce it even in my test code). Also, I confirmed that I do create the ellipsoid, only because I call the exact same function. (when adding manually or via Json) In the attached file (index.html); you will see "Edit work" on the top left corner ...if you selected "Create New" and keep adding cylinders while moving them after you add them one by one ...you will find it is works fine ...it moves the cylinders ...allows me to add different sizes etc. -- also it detects collisions correctly (also changing color as programmed). However, if you selected "Create from Json" -- the data preloads the cylinders and as soon as you try to move them ...they disappear from the scene; The code to add cylinders by clicking on "Add Cylinder" -- (one by one) and ...adding cylinder from Json is 90% same; calls the same functions; yet the JSON loading does not work. Please note : You will need to reload the page when switching between "Create from Json" and "Create New" . Please let me know if you find anything obvious; while I am also trying from myside. Thanks! drag_json_problem.zip
  3. dhiru

    moveWithCollision issue -- quirks

    I am definitely not saving the mesh.ellisoid; but the strange thing is; when I add new objects they are able to recognize the loaded meshes (when using moveWithCollision()). It is only when I pick the old objects and try to move them when they vanish. Let me break my code and get all the scripts out in a neat HTML page so that I can show you the problem. As always, many many thanks for your help.
  4. dhiru

    moveWithCollision issue -- quirks

    Hi Wingnut/Arte, I build a simple scene where I allow adding cylinders one by one to arrange them as the user pleases (in a container) -- this works ok; but if I save the users work and reload the scene (from JSON)....every time I try to move the meshes they get removed from the scene!. There is no remove in my code; which means that I am missing to "set" something when I try to preload the scene. I tried to create it on the playground but since I don't have access to creating buttons that can simulate the "preloading" of assets --its hard. Would it be fine if I host it on a server and give you a link to see why the move causes the Meshes to get removed from the scene (its very strange). What is also weird is ..if I add the objects in the same scene one by one; only those meshes it allows to be moved (without getting removed). Any advice would be helpful -- let me try to create an independent html that will simulate this so that I can attach it.
  5. dhiru

    moveWithCollision issue -- quirks

    Cannot thank you enough for so much explanation! -- I am going over it again to make sure I understand it.; I will definitely share with us once I have something to show. When I saw your explanation and the playground link; my immediate impulse was to save the code along with the explanation before it got deleted "The secret to creativity is knowing how to hide your sources". Thanks again -- would have never got this far.
  6. dhiru

    moveWithCollision issue -- quirks

    Back to studying observables -- I realize that I will have to use keyboards since it is difficult to move on the Z axis using mouse (vertical direction movement). I cannot thank you guys enough for saving so much of my time; If I had to build a game like "zenga"; and I wanted to calculate the force that comes on the most bottom tile, do the physics engines give me any kind of "force" output ? -- numerical values ? (just curious). -- also if/when I start using the Z axis in placing loads and apply gravity; it will fall to the bottom tile automatically and "balance" if there is space ? --right. Just curious how the keyboard will allow me to pick the object; how/when the gravity gets applied on objects. Either ways, I now realize that I have a long way to go; many thanks; I realize my doubts reveal that I don't have a lot of knowledge -- but I have to start somewhere.
  7. dhiru

    moveWithCollision issue -- quirks

    Many thanks for this (this saves me so much time), I will start creating planes instead of a box. Just to give you an idea of how much you guys saved me --- last night I wrote code to "correct" the overlap by recording the last correct value and changing it onPointerUp. (talk about over engineering). But weirdly this only works if I move the cylinder slowly; and only correctly for the left cylinder (plus sometimes it does not work right) when I try to re-adjust. To further over-engineer-- I then decided to calculate the direction of the trajectory (slope of the line) and back out to the actual position such that they are just touching. (now you know how much you saved me). Here is my foolish effort http://playground.babylonjs.com/#32E8TZ Need your suggestion : My final the goal is to be able to arrange objects so that I can "reliably" calculate the distances (given my the users arrangement) -- like a puzzle. -- my question is: do you think -- if the objects are arranged using this touch / collision feature -- the calculations be trustworthy (if I build a score)? -- I don't see why not; if all my objects are rigid bodies; please comment!!! Thanks again, Dhiru
  8. Hi, I am simply trying to arrange items in a box (kind of like a shopping bag) however I am unable to "detect" collision correctly. In the example I created, I have two simple cylinders in a box; but the cylinders collide till the half of their radius. Also once they collide with the container (box) ... also half; you can never drag them back http://playground.babylonjs.com/#8CDJXW Could you please advice what I am doing wrong. Thanks, Dhiru
  9. Many thanks! -- I will try and let you know if I can find something simpler!
  10. Hi, I have created labels that shows my objects on the top of the screen; however unfortunately the objects use brickProceduralTexture which take brick color as Babylon.Color3 woodTexture.brickColor = new BABYLON.Color3(rColor / 255, gColor / 255, bColor / 255); however I want to match that with the background color of my BABYLON.GUI.Rectangle; which takes the background as a Color; to avoid confusion I wanted to match the colors. var label = new BABYLON.GUI.Rectangle("label for scorecard"); label.background = "black"; I am sure there is something simple I am missing -- I tried reading the documentation and also passing different colors but could not get it to work. Please advise.
  11. Hi, I have created simple objects with specific textures; I want to describe my convention of what each texture implies; So I thought I would draw a plane (billboard) along with the texture look and write text on it using dynamicTexture; I am not sure how I would do that ? -- would I need to create two planes (one for text one for procedural texture with alpha values) -- I am sure I am missing something simple. I have pasted below my attempt of trying to write text "hello world" on my procedural texture https://www.babylonjs-playground.com/#24C4KC#29
  12. Merci Beaucoup! -- sorry for not checking the grassProceduralTexture.js. I also had a similar problem with the marbleProceduralTexture.js -- I don't think we have a marbleColor / marbleColors In time I will share my project for everyone's benefit -- many thanks!
  13. Hi, I have a very simple need to change the grass color to brown (kind of burnt grass) -- typical of desert color -- but no matter what I do the color does not get changed ! -- what am I doing wrong. Please advise; following is the playground link https://www.babylonjs-playground.com/#MFM09N
  14. Many thanks for this!; I will study them and work on them now. Thanks a lot!