• Content count

  • Joined

  • Last visited

About juanmajr93

  • Rank
    Advanced Member
  • Birthday 08/02/1993

Profile Information

  • Gender
  • Location

Recent Profile Visitors

1,126 profile views
  1. LeapMotion with BabylonJS

    hi @Deltakosh yes there is a JS API. You can see it here: https://developer-archive.leapmotion.com/getting-started/javascript https://developer.leapmotion.com/documentation/javascript/index.html I have to integrate this system with my web-based app...
  2. LeapMotion with BabylonJS

    Hi guys I go back here to ask you about the integration of leapmotion with BabylonJS. My last experiments using WebVRCamera work fine but I must add leapmotion to interact with 3D environment. I have the follow questions: 1) Is posible integrate leapmotion to surf arround the scene with UniversalCamera? 2) After first question, can I use leapmotion with HTCVive? Best regards, Juan Manuel
  3. Creation of ground

    hi @JohnK I have set the polygon under the area that I have to cover. See it in the follow image. The follow goal is to define the heightmap of this polygon which must be the same to the ground. My final objective is to delimite different areas of the ground which represent an interesting feature of the terrain represented. Maybe another solution could be the representation of custom mesh where I could define each point and set them to the level of ground. Other solution could be an extrusion of polygon to the level of ground. Both can be developed?
  4. Creation of ground

    Hi @Deltakosh, @dbawel, @Wingnut, @jerome l have considered that create a ground like a irregular figure is imposible with BabylonJS. If I use a material or texture with an alpha channel, I don't get the results that I want. This material is applied to all parts of ground. Another question is relative to the creation of some information layers overlapping to the ground. My first idea was drawing a polygon whose points had the coordinates x and z (choosen by me) and y (defined by the height of ground). However, It does not work because de polygon is plane. Could you help me? Thanks in advance.
  5. Creation of ground

    @jeromeYes, I knew these parameters but i have to create a ground like the follow polygon:
  6. Creation of ground

    Hi team, I would like to create a ground in my scene. However I don't want that it was square, is it possible? Thanks!
  7. HTC Vive with WebVRCamera

    Hi, I am developping a virtual environment using webVRcamera to render it with HTC Vive Headset. I have no problems to see the scene into HTC Vive, however, I cannot move, the controllers do not work. I have tested this playground and there I can't move too. How could I solve it? http://playground.babylonjs.com/#ASDZLT#20 Thanks!
  8. Hi team, @Deltakosh I have a question relative to the optimization of my scene. I have to load a huge amount of building models to represent a 3D city enviroment. I need to improve the FPS of my scene. In recent days, I have tested the SPS but each building is a different mesh and I don't reach an important improvement. All of this buildings share the same texture and material but each of them have a lot of triangles... How can I get a great performance for rendering of all them? Thanks!
  9. SPS with different models

    @jerome@JohnK I will try to create a playground but I have a some of javascript vector in my localserver.... The error is in the function that I have published. My main goal is reduce to one mesh all of building of my scene. By this way, I will improve the performance of my web application. Maybe, if there are another ways to do this without SPS please tell me...
  10. SPS with different models

    @jerome I share my scene:
  11. SPS with different models

    I have added this line and nothing... To visuaze something I have to create the mesh spsEdificios.buildMesh(); after the function addShape()... In this case, only one of the building model appears like a particle of SPS...
  12. SPS with different models

    @jerome Well, it is a good news. How can I show you my problem?? I will try to explain my code, I load different models in my scene with this: var edificio = loader.addMeshTask(t, "","<?=$url?>assets/modelos/",edificios_texto[t]+".obj"); After this, I have implemented a "edificio.onSuccess = function (task){}" and there I have added the follow lines: spsEdificios.addShape(nM, 1, {positionFunction: myPositionFunction}); //I use only "1" because each particle is a different building model nM.dispose(); Finally, when bucle (forEach) is finished I create a mesh: var redEdificios = spsEdificios.buildMesh(); However, It doesn't work SPS has only one particle and it doesnt appear in the scene... Thanks!
  13. SPS with different models

    My main question is: is possible creating a SPS with different obj files imported?
  14. SPS with different models

    @jerome I only have one particle that is the first building model. The others buildings are meshes of the scene. Theese lines of code are repetied to each loaded, I think that this is the error... but I don't know the solution. var buildings = spsEdificios.buildMesh(); spsEdificios.mesh.hasVertexAlpha = true; If I change the code by this way I have the follow error: babylon.js:14 Uncaught TypeError: Cannot read property '6' of null var models = function(edificios_texto) { var t = 0; var loader = new BABYLON.AssetsManager(scene); edificios_texto.forEach(function() { if(edificios_texto[t].length!=2){ return; } var edificio = loader.addMeshTask(t, "","<?=$url?>assets/modelos/modelos/",edificios_texto[t]+".obj"); var nM;// malla de edificio edificio.onSuccess = function (task) { task.loadedMeshes.forEach(function(b) { b.scaling = new BABYLON.Vector3(2.65, 2.65, 2.65); b.rotation.y = Math.PI; b.computeWorldMatrix(true); // cambiar las X var vertex_data = BABYLON.VertexData.ExtractFromMesh(b); for (var i = 0; i < vertex_data.normals.length; i+=3) { vertex_data.positions[i] *= -1; } vertex_data.applyToMesh(b); }); nM = BABYLON.Mesh.MergeMeshes(task.loadedMeshes); nM.checkCollisions = true; var myPositionFunction = function(particle, s) { var utmPlaceX = edificios[i].x; var utmPlaceZ = edificios[i].z; var utmPlaceXFromCentre = utmPlaceX - mapCentreX; var utmPlaceZFromCentre = utmPlaceZ - mapCentreZ; var x = utmPlaceXFromCentre/scaleX; var z = utmPlaceZFromCentre/scaleZ; particle.position.x = x; particle.position.z = z; particle.position.y = alturas[ edificios_texto[edificio.name]]; particle.name = edificios_texto[edificio.name]; particle.color = new BABYLON.Color4(0, 0, 1,0.5); }; spsEdificios.addShape(nM, 1, {positionFunction: myPositionFunction}); nM.dispose(); } t++; }); var redEdificios = spsEdificios.buildMesh(); loader.load(); };
  15. SPS with different models

    @jerome I understand you but all of my code works fine. However, to each onSuccess function I am building a mesh (var buildings) and this is the error. Could you show me an example of SPS with different obj models? Thanks!