Jump to content

jdurrant

Members
  • Content Count

    52
  • Joined

  • Last visited

Everything posted by jdurrant

  1. Hi all. I reloaded in private browsing, but I still had the same problem. I asked some of my students to test it on their phones, and it worked fine for them. So strange that I can't reproduce this problem on anyone else's phone. Makes debugging very difficult! Thanks for your help just the same. All the best.
  2. Very interesting that it did work for you, @MarianG . I'm on Android 7.0, LG G6, Firefox 57.0.4. Anyone else able to reproduce this problem? Thanks!
  3. Hi all. I fixed the "engie" error and changed to the full url: https://durrantlab.bio.pitt.edu/tmp/minimal_test_firefox_mobile_prob2/skybox.png The error persists in Firefox on Android, though. Here's an updated version of the code that still causes the same error: https://durrantlab.bio.pitt.edu/tmp/minimal_test_firefox_mobile_prob2/ Thanks, Jacob
  4. I'm having an odd problem loading a texture on Firefox for Android. It seems to work on every other browser I've tested. Here's a url with an example of the problem: https://durrantlab.bio.pitt.edu/tmp/minimal_test_firefox_mobile_prob/ Here's the complete html code of that example: <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> <title>Test</title> <meta name="viewport" content="width=device-width, minimum-scale=1, initial-scale=1
  5. I just wanted to thank the community. I recently published a scientific article entitled "Pyrite: A blender plugin for visualizing molecular dynamics simulations using industry-standard rendering techniques": http://onlinelibrary.wiley.com/doi/10.1002/jcc.25155/abstract It uses Babylon.JS for the in-browser visualization. You can see a demo here: http://durrantlab.com/apps/pyrite/web/ I'm using Babylon for other projects in my lab as well. What a great engine! All the best.
  6. Works great @RaananW ! Thanks for your help. If I'm not mistaken, camera.getTarget() is a defined function. Why not have it return the average of the two getTarget() values? In case it helps others, here's a working example: https://www.babylonjs-playground.com/#7DYN70#12 All the best.
  7. I've used camera.getTarget() to advance a character forward, as described here: It's worked well with a FreeCamera, but I can't get it to work with the WebVR camera. camera.getTarget().subtract(camera.position) always returns the same vector regardless of what I'm looking at through the VR headset. It was a bit tricky to demonstrate in the playground, but I managed: https://www.babylonjs-playground.com/#7DYN70#11 That demo starts with a FreeCamera attached to the canvas. Open up the JavaScript console, and you'll see that it's logging the camera.getTarget().subtract(camera.pos
  8. Thanks, all. It seems I was using a slightly out-of-date version of babylon.js. Both the online playground and my local copy were 3.1-alpha, but apparently not the same 3.1-alpha. Using BABYLON.SceneLoader.Append, rather than BABYLON.SceneLoader.Load, also seemed to be important. Hope all this helps someone else. All the best.
  9. Thanks for your help, @Deltakosh . The playground scene you posted works perfectly. (Remarkable scene, BTW, to view in the HTC Vive!) I see both the scene and the controllers. But I continue to have troubles. Here's what I've done to debug so far: STEP 1: I took your exact code, except I swapped in my .babylon file: http://playground.babylonjs.com/#E0WY4U#16 Success! I could see my (unlit) scene as well as the Vive controllers. STEP 2: I created my own local playground. My server is on localhost:8000, started via python: python -m SimpleHTTPServer 8000 Here
  10. Thanks for your help with this, @dbawel . But I haven't experienced your same problem with the Vive controllers. They have always connected for me in other applications, including web-based apps such as those posted at https://mozvr.com/ . They have also always connected in babylonjs apps for me when I create the scene (including the camera) from scratch. It seems to be something specific to trying to load an external .babylon file and then trying to use controllers. I wonder if I'm replacing the .babylon-file camera with the WebVR camera incorrectly... Thanks.
  11. I recently got my hands on an HTC Vive, and I can't even express how excited I am about this technology! Babylon.js works well with the device too. I'm just thrilled! I have run into what I think might be a bug, though. When I load a .babylon file that I exported from Blender and try to hook in a WebVR camera, the controllers don't show up. I can't figure out how to open up an external .babylon file in the Playground, unfortunately, but here's my code: function makeWebVRCamera(scene, position) { var metrics = BABYLON.VRCameraMetrics.GetDefault(); var camera = new BABYLON.WebVR
  12. Thanks, @RaananW ! Very helpful.
  13. I realize this question is very old, but I'm interested in doing the same thing. Did you ever find a solution? Thanks!
  14. @JohnK , you had the right idea. @RaananW , I see now that visibility wasn't the right tool. I was thinking that two meshes, each with 0.5 transparency, should not let any background through when viewed aligned, since 0.5 + 0.5 = 1.0. But it makes sense that it would be multiplicative rather than additive. 0.5 * 0.5 = 0.25, so 25% of the background should go through. Perhaps the effect I was looking for is like Photoshop's "overlay" filter. Not sure... @JohnK , your solution wasn't perfect for my actual case because, unlike the playground scene I created, my actual scene involves tra
  15. I want to seemlessly fade between two meshes with very similar materials. My thinking was that if the sum of the visibility values on each was always 1.0, there would be no transparency visible through the both of them together. But in practice that's not the case. I made this playground to illustrate: https://playground.babylonjs.com/#69K17Z#2 Note that the visibility on one of the grass planes goes down exactly as the visibility on the other plane goes up, such that the two visibilities always sum to 1.0. However, during the transition, the fire plane in the background can briefly
  16. I was too quick to post my question... I found the answer here: For reasons I don't understand, BABYLON.VideoTexture includes a parameter to flip the video across the Y axis. I had that value set to true. So my line: let videoTexture = new BABYLON.VideoTexture("video", ["baked.mp4"], scene, true, true); should have been: let videoTexture = new BABYLON.VideoTexture("video", ["baked.mp4"], scene, true); Hope this helps someone else!
  17. I'm struggling with video textures. I created a simple icosphere in Blender, unwrapped it, and exported it to a babylon file. I then loaded that babylon file in the browser and positioned the camera directly at the center of the sphere. I added a video texture to the sphere's emissive texture, but it doesn't render correctly. It's almost as if it's not respecting the UVs: I naturally thought the UVs must have gotten messed up somehow, but when I create a regular texture using a single frame from the video, it looks perfect: Here's my TypeScript code: declare var BA
  18. Thanks for your help, JCPalmer. Just to clarify, you mean I should save the different shape keys as separate meshes (in blender) and then programmatically create a morphTargetManager? Can you provide a code outline? Also, would you mind pointing me in the direction of your implementation of shapekeys? It seems the one I'm using now isn't ready for prime time. Thanks.
  19. I'm using the preview release of Babylon (3.0. alpha) and the 5.3.-1 exporter in Blender. The Blender scene includes shape keys attached to a mesh called "Cloth": When I export to a babylon file, this information appears to be saved correctly. There is a "MorphTargetManager" entry in the file JSON that looks like this: "MorphTargetManager": { "id": "Cloth", "targets": [ { "name": "Draped", "position": [lots of numbers...], "influence": 0 }, { "name": "testtest", "position": [lots of number
  20. Very handy function! But it seems it has to be called early in the load process. See https://www.babylonjs-playground.com/#H52JTC#7 In that example, the first resize works great, but when I try to resize the textures again later (on click), it doesn't work. I show a settings page when the user starts my app. The scene begins to load immediately in the background. One of the options on the settings page is to use low-res textures. But by the time the user presses "Start" on that page, the load process in the background has progressed to the point that the texture resize doesn't work.
  21. Hi all. I was able to resolve this problem by unwrapping the mesh manually (marking seams, etc.). I also divided the mesh into four separate meshes, which may have contributed to the solution. I'm still not certain why it happened on the other version of the mesh, though. For what it's worth, with the new manual unwrapping the mesh did not have to be divided on export. I suspect that's where the problem lies. With low-res shadow map:
  22. Also, for what it's worth, I tried different backFaceCulling settings on the material (true and both), but that didn't fix the problem either. Thanks!
  23. Hi V!nc3r. Just to be clear, I was using Blender to show that the textures do render correctly in that context. I'm not using the diffuse texture that Blender would export. Though I am using the baked shadow texture. Here it is:
  24. Thanks for your help. Here's the PG: https://www.babylonjs-playground.com/#H52JTC
  25. Seems silly to be following up two years after this question was originally posted, but I once again need to resize textures in babylonjs. If scale() does not apply to standard textures, then how is BABYLON.TextureOptimization able to scale all the textures in the scene? I'd now like to be able to create a function that resizes all the textures on the fly, independent of scene optimization. Something like resizeAllTextures(scene, maxWidth). Is it possible? This doesn't work: for (var index = 0; index < scene.textures.length; index++) { var texture = scene.textures[index];
×
×
  • Create New...