• Content Count

  • Joined

  • Last visited

Everything posted by larsiii23

  1. Ok. The links I added now should work at least
  2. I have tried to apply the SceneOptimizer which results in a great part of the meshes in the scene become invisible. They are still there as collision still are being handled, but they are not visible. Doesn't matter if the degradation level is low, moderate or high. The meshes that "disappear" are for the most part bigger simple structures like walls, floors and ceiling with no textures assigned. Do anyone know why this is happening? Screenshots before and after the SceneOptimizer is called: Before After
  3. Thanks! Everything is back working again.
  4. Hi! I also have som problems with VideoTexture after the last push to the git repo. I see that the boolean parameter invertY is added to the VideoTexture constructor. Don't know what this propery do (flip the texture?), but I get the error "Uncaught TypeError: Cannot read property 'push' of undefined" either if I set this parameter to true or false. Sample: mesh.material = new BABYLON.StandardMaterial("textVid", scene);mesh.material.diffuseTexture = new BABYLON.VideoTexture("video", "theURLofTheVideo", 1024, scene, false, false);
  5. Good initiative. Am a little busy these days, and not a hell of a writer neither to be honest. If you don't bother adding it to the wiki that would be very nice. I can take a look and see if I got anything to supply. Not familiar with wiki markdown, but I'll guess it's not to hard to learn
  6. Yeah, I agree that "problem" is not the best word to describe it, but I couldn't come up with a better term at that moment
  7. As I understand there is by default no UV mapping on planes in Blender, but it can be done manually in Blender. I have added textures and done the UV mapping on other planes in Blender, then exported to Babylon, and that works fine . The problem was therefore not related to the VideoTexture in particular, but generaly adding texture to non UV mapped meshes imported from blender. If any Blender experts find this statement incorrect, feel free to correct it. So my conclusion is: Adding texture in JavaScript to geometry imported from Blender does not work out. But there are two ways of solving this problem: Do the UV mapping in blender before export. Do the UV mapping of the imported mesh in JavaScript manually
  8. Interesting. These are the values I get: For the plane created in javascript (that works): uv: 0,0,1,0,1,1,0,1 pos: -2.5,-2.5,0,2.5,-2.5,0,2.5,2.5,0,-2.5,2.5,0 ind: 0,1,2,0,2,3 For the plane imported from the blender scene (that doesn't work): uv: null pos: 1,0,-1,1,0,1,-1,0,1,-1,0,-1 ind: 0,1,2,3,0,2 So it looks like there is some problem with the uv mapping for the blender imported plane. By then setting the uv coordinates manually in the javascript fixed the problem! setVerticesData("uv", array_of_UV_coordinates, true) Thank you so much for your help Wingnut! Screenshot
  9. First I tried with a simple plane (it was rotated 90 deg around x, and scaled to make make it widescreen), 1 face, 4 vertices. I applied a material in blender. Tried again without applying a material, and without scaling. But I got the same result. The audio playes, but the plane is all in one color, which I expect is the color of the topleft pixel of the video of any time. The color of the plane change according to which color that can be seen in the topleft corner.
  10. If I create the plane in the javascript eveything works fine. The problem I described appears when I try to apply the video texture on a plane imported from a blender scene.
  11. Thanks for your input, Wingnut. You definitely solved my second problem. I see this thread is raising much of the same issue as I am, without getting any clear solution. I will keep you posted on any progress.
  12. Hi! In my Babylon scene I have a room with a plane, representing a screen. My idea is to display a video on this screen when it's clicked and turn it of if it's clicked again. Code: var screen1 = scene.getMeshByName("Lerret");activateVideoTexture(screen1);function activateVideoTexture(mesh){ mesh.actionManager = new BABYLON.ActionManager(scene); var action = new BABYLON.ExecuteCodeAction(BABYLON.ActionManager.OnPickTrigger, function(){ mesh.material.diffuseTexture=new BABYLON.VideoTexture("video", ["01_Tumor-Glioblastoma.mp4"], 640, scene, true); mesh.material.emissiveColor = new BABYLON.Color3(1,1,1); }); var action2 = new BABYLON.ExecuteCodeAction(BABYLON.ActionManager.OnPickTrigger, function(){ mesh.material.diffuseTexture.dispose(); mesh.material = new BABYLON.StandardMaterial("texture1", scene); }); mesh.actionManager.registerAction(action).then(action2);}I've got to major problems: 1: When the VideoTexture is activated/applied the screen only show the very top left corner of the video (i think). The screen is all brown, which is the color in the top left corner in the video. It seems like the plane just projects the color of the top-left pixel in the video I also get this warning in the console "[.WebGLRenderingContext-05B3F9D8]RENDER WARNING: there is no texture bound to the unit 1" So how do I make the video fit/stretch to the size of the plane it is applied to? I've set the size parameter to 640, which is the pixel width of the video. Don't know if it is this "size" is refering to. 2: When you click the second time I want the videoTexture to disappear, which actually works as it is now, except that the sound continues. How can I handle this?
  13. Sorry, but the reason to the problem was only my own code. I had forgotten to remove a line which translated the last added mesh to origin. Useless thread, can be deleted
  14. Update: I added another dummy mesh to check if that mesh also would translate to origin. And it did. However that made the ramp to be placed at the correct spot on top of the stairs. Even though I've found a soultion, it would be nice if anyone know why this is happening.
  15. I'm having a problem regarding meshes that is translated to origin during the process of exporting the Blender scene to Babylon file. To be more specific: In blender I have imported a model of a house. But I want to some modifcations on this. For example am I trying to create a ramp in the stairs to smoothen the movement going upstairs. I have done this by creating a plane witch i place over the stair (and later on make invisible). The plane is placed so the 4 vertexes of the plane intersects the vertexes of the top and bottom stair. In blender it looks perfect, but as I export it to a babylon file and renders it in the browser the plane/ramp has been translated to origin (0,0,0). All other meshes stays where they are suppose to. The plane I have added is the only mesh that is translated to origin. Rotation and scale stays however true to what it is assigned in Blender. Is anyone familiar with this problem, and have a solution to it? Thanks in advance.
  16. Thanks. Exactly the solution i was hoping for I implemented the checkCollisons in the callback, like this: BABYLON.SceneLoader.ImportMesh("", "", "1932.babylon", scene, function (newMeshes, particleSystems, skeletons){for(var i=0; i<scene.meshes.length; i++) scene.meshes[i].checkCollisions=true;});After this change I feel the "game" got more laggy however. Is there a better (performance enhancing) way to this. My scene consist of a 3 floor house I want to move around in, in a fps way.
  17. Hi! I'm currently working with a project where I decided to use babylon.js, and is a newbie on the framework. I have imported a BIM-model which consists of hundred of meshes into babylon, and wondered if there is a way to check collisions for all these meshes without have to get each mesh by name, var mesh = getMeshByName("meshName"); and then assign it mesh.checkCollisions = true;Is there a way to loop through all the importet meshes without getting them by name?