juanmajr93

Members
  • Content count

    114
  • Joined

  • Last visited

About juanmajr93

  • Rank
    Advanced Member

Recent Profile Visitors

574 profile views
  1. 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!
  2. 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!
  3. @[email protected] 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...
  4. @jerome I share my scene: http://150.214.174.25:8029/vr
  5. 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...
  6. @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!
  7. My main question is: is possible creating a SPS with different obj files imported?
  8. @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(); };
  9. @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!
  10. Hi team, @jerome @Wingnut I have an question relative to solid particle system (SPS). I need to create a SPS composed with different buildings (.obj files). This is my code but i only can add one of them. How can I solve it? 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/",edificios_texto[t]+".obj"); var nM; //mesh of building 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); 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); for (var i = 0; i < edificios.length; i++) { if(edificios[i].descripcion == edificios_texto[edificio.name]){ 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.color = new BABYLON.Color4(0, 0, 1,0.5); }; spsEdificios.addShape(nM, 1, {positionFunction: myPositionFunction}); nM.dispose(); break; } } var buildings = spsEdificios.buildMesh(); spsEdificios.mesh.hasVertexAlpha = true; } t++; }); loader.load(); }; Thanks!
  11. Hi @MrVR the unique way to display content with browser of GearVr is using the WebVrFreeCamera. The other cameras of VR don't work inside GearVR headset. Now I am working with this headset but disabling the service with app (package disabler pro) and I can launch my scene with Chrome.
  12. yes just it! @Raitch I have to short the visual distance and try by this way to reduce the effort to render all models of my scene (frustum planes)
  13. @Temechon @Raitch it is well but it is not exactally that I want. I only want to show the part of scene which are near of camera but not disable all mesh unless render only the part that is nearer to me..
  14. Hi all, do you know anyway to render only the models that are near of camera (I would define a radius and I can only see the models inside this area) is it possible? Thanks!
  15. Hi, i am a developer of vr application and i have a problem with the VRDeviceOrientationFreeCamera relative to anti-aliasing. My scene is good but when I change to this camera all models of my scene have a bad appearance, with no anti-aliassing. The resolution of this escene using the vrCamera is very low... How could be the cause?