• Content Count

  • Joined

  • Last visited

About pichou

  • Rank
    Advanced Member

Contact Methods

  • Twitter

Profile Information

  • Gender
  • Location

Recent Profile Visitors

874 profile views
  1. Most of the time geoJSON are made of latitude/longitude coordinates which you can easily translate to babylonJS Vector3 with this function : let getVectorFromLatlng = (lat:number, lng:number, radius) => { var phi = (90-lat)*(Math.PI/180), theta = (lng+180)*(Math.PI/180), x = (radius) * Math.sin(phi)*Math.cos(theta), z = (radius) * Math.sin(phi)*Math.sin(theta), y = (radius) * Math.cos(phi); return new BABYLON.Vector3(x/3, y/3, z/3); }
  2. pichou


    A lot of very nice feedback since WAZANA.IO is featured on the BABYLONJS homepage. I suspect you guys to help me make this game even better! Huge thanks
  3. pichou

    Plane tangent to a sphere

    Hi @ssaket, I needed to keep my latitude longitude approach but thanks to your suggestion, I managed to get the right formula: https://www.babylonjs-playground.com/#VDG184#9 Thanks, I didn't know about the alignWithNormal function but very useful! Cheerz
  4. I am sure the problem is already solved somewhere and well known but I can't find a working solution. I have a sphere with planes around it and I need those planes to be tangent to the sphere depending on its position. I have made a playground with my basic setup: https://www.babylonjs-playground.com/#VDG184#2 You will see 2 solutions I tried but which are not working, one using path3D and one with basic math. Thank you, Pichou
  5. pichou

    task file weight

    Ok I know how to do it then. But that means I will have to load the files twice and I don't want to do that both for the servers and clients. Guess I will find another way! Thanks for your help @Deltakosh
  6. pichou

    task file weight

    When I go to my network console and look at the headers, there is always the Content-Length. Maybe there is a way to get the xhr of a task in the assetManager? This way I could calculate the weight I am looking for?
  7. pichou

    task file weight

    Hum I see! I found we could get the length with the xhr like this : ```parseInt(xhr.getResponseHeader("Content-Length"))``` if you already use it for the progress, I guess we can also have it somehow when the loading is finished? If some task/file doesn't have Content-Length indicated by the server it is ok because the result I want doesn't have to be exact.
  8. pichou

    task file weight

    Nope to be more specific, the exact thing I am looking for is to know the entire scene weight. Meaning what is the total of data in bytes that need to be loaded in order to render the scene. So after everything has been loaded and not during the progress. Maybe a way to reach the "Content-Length" header of each asset request?
  9. pichou

    task file weight

    Hello babylonjs community, Is there a way to have the file weight uploaded with the assetManager whatever the type of file? Cheerz, Pichou
  10. pichou


    Sorry @Deltakosh I haven't seen you asked for a screenshot. I even have a better stuff illustrating the game for you (hope this is not too late) :
  11. pichou

    issues with toEulerAngles

    Very nice simulation! Indeed it hasn't change much my computer performance eventually. I think this is more my curiosity which has pushed me to ask!
  12. pichou

    issues with toEulerAngles

    I have another question link to quaternion calculation. I am sure there is not a straight answer but how hard will rotationQuaternion be on CPU/GPU compare to basic rotation? I feel like maybe my last changes with quaternions made my computer less happy!
  13. pichou

    issues with toEulerAngles

    Thanks a lot for you answers. @JohnK your solution was perfect for my needs. I indeed didn't know that we had to set the rotationQuaternion to null before setting new rotation values. But now I get the exact result I want! Cheers!
  14. Hello everybody! Hope everyone is going well in the Babylon community ! My issue is simple : I use the mesh.rotate() function in order to rotate a mesh in the BABYLON.Space.WORLD. The function works great and my mesh rotate exactly how I want. The mesh.rotate() function use quaternion and so the rotation attribute is set to Vector0. But when the rotation is hover I would like to have the euler rotation back! To do so I use the mesh.rotationQuaternion.toEulerAngles() function But if I set the mesh.rotation = mesh.rotationQuaternion.toEulerAngles(); Then the mesh is rotating again on my screen like if the euler angles I get from the quaternion wasn't right. There is a lot of topics in this forum concerning this toEulerAngles function but after hours of reading and testing (even changing ZYX, YXZ orders), nothing is working! Is there an other way to get the euler rotation vector back from the quaternion? Or maybe a simplier way to rotate mesh around a world axis? Thanks for your help!
  15. @Deltakosh, you are saying my png image has a background? Why is it working with just hasAlpha then? @V!nc3r, I haven't tried yet but is the tga format the format you advise to use when working in babylonjs? Thank you guys!