• Content count

  • Joined

  • Last visited

  • Days Won


Everything posted by Pryme8

  1. I got permission to post this... super simple but might be of use to someone!
  2. I can not say the client due to NDA, but maybe here soon I will eb able to! That is because the meshes were the results of a mesh merger and had no normal data, (well blank normal data)
  3. This, is close...
  4. FBX is a pain.... I was going to write something up for it a while ago... but It was not easy and took way to much time so I kinda dropped it.
  5. STL was super easy, I can not release what I did today but in like no time I was able to grab the indices and calculate the facet normal from the points then create and ASCII STL file save it as an octet-stream and bam... Im exporting from BJS now. I will ask the company that I made it for if I can supply this code to y'all, but they own it so I cant without written consent. Seriously though it took like an hour to get it right, what format are you trying to export out as? Id say go to its wiki and read its structure then start going down the line of what you need to include and how to get them out of the BJS data.
  6. I am writing up one for STL format today for a client... I will have to ask permission to submit it to public domain though, and if they say yes Ill make an update on my branch or submit it to someone who can convert it to typescript. Just reverse the importer.
  7. -Please Delete, extra post.
  8. I'm having trouble finding information on how to combine simple meshes (not primitives but imported STL's). I have googled and found a few references but most of them are dead ends and when I search the forum for CSG I come up with nothing... I see the FromMesh function, and have tried to implement it but i get a error of length undefined, so I want to try the FromPolygons method but cant seem to find any information on it. Is the CSG only limited to primitive shapes? The meshes I am trying to combine are fairly simple under 100 polygons for the most part and nothing over 300. Are there other methods for the combination of geometry data, but getting rid of the "internal" points? here is the snip it of code that I am using to try this, but like I said I get an error with the FromMesh method: *I also tried with new declaration on the CSG var step = stack.splice(stack.length-2, 2); var mA = step[1]; var mB = step[0]; mA.makeGeometryUnique(); mB.makeGeometryUnique(); console.log(mA);console.log(mB); var csgA = BABYLON.CSG.FromMesh(mA); var csgB = BABYLON.CSG.FromMesh(mB); mA.dispose(); mB.dispose(); console.log(csgA); Which drops the error: Uncaught TypeError: Cannot read property 'length' of undefined at Function.r.FromMesh (babylon.custom.js:27) at KIRA._combineStackStep (KIRA.0.0.3.js:815)... Ill try to whip up a Playground.
  9. got it... Ok so you have to have uv data to create the CSG. I will here at some point fix that, but until then here is the quick workaround. Now, I am wondering what is going to be the best way to get the polygon count down after a combining the objects? I get a huge jump in polygon count when I create these, which is understandable to some extent, but seem to be quite excessive.
  10. There are not any concurrency issues that I can see, It seems that the CSG is expecting there to be uv buffers, but none of my meshs have uvbuffers... Im thinking the fix will be to set a blank uv buffer on the mesh before I try to make it a CSG.
  11. I cant really get any errors to drop... but it does not work. If I remove everything dealing with CSG it gets to the point of disposing the meshes that were imported... but I am unable to do anything with the CSG. Agian i tried with and without the new declaration. Also with this it is saying that isVerticesDataPresent is false, so that might be whats going wrong here? But then says that the vertex Data is available... Im pretty confused. Ahh ok, the script is dropping and error on this like respectively in the CSG method: uv = new BABYLON.Vector2(uvs[indices[i + j] * 2], uvs[indices[i + j] * 2 + 1]); and in this playground I can see that the method: .getVerticesData(BABYLON.VertexBuffer.UVKind) returns null on my mesh. So I am thinking this may be the culprit. What are my options? Maybe create a blank uv array and assign it to the mesh before I try to make it a CSG?
  12. I really am struggling with trying to figure out how extend babylon to be able to parse binary STL files. Does anyone have any good sources on how like Three.js or sketchfab does it? I have been googling my heart out and seem to keep hitting dead ends. Maybe a different angle will help me figure things out.
  13. Ive always associate io with "intensive operation", input/output works too
  14. Ok so it was just the binary files that were giving me trouble. thanks for your help!
  15. Back from the dead ^_^_^ MUAHAHAHA.... Anyways, I am loading an external STL, and everything seems to be going as planned. The file loads but nothing ever appears in the draw stack. It shows that there is a loaded mesh, that it contains polygonal data etc, but the draw calls remain at 0. Its been a while seine I have worked in BJS so I kinda don't even know where to start debugging this. This is the STL file and here is a screenshot of the debug layer: Any help on this would be greatly appreciated.
  16. Just added some playgrounds. I think the problem I was having is some of the STL's were binary and some of them were also badly formatted ASCII. Kinda stumps me though, it looks like the mesh loaded but I get no draw calls... I pretty much moved onto a different STL and the issues stopped, but thought this was weird behavior. Is it because the mesh is not in the cameras view?
  17. Ok I think I may be doing it wrong... Do I have to load the STL with BABYLON.SceneLoader.Load()? and not the asset manager? I found but the information on there was not much help. Does anyone have a working example of a STL being loaded (ASCII because of no binary support) The thing that is tripping me out is the fact there are no draw calls though there is and active mesh. Here are two playgrounds showing it does not work: - this one is using the AssetManager - this one is using the SceneLoader The SceneLoader one does not even finish up because of an error in the STL loader. I have also tried the a different STL file to verify and im getting the same errors it seems: at least on the SceneLoader it seems to work when I use the AssetManager. **Kinda Solved... Im thinking its just because some of the STL files are crap...
  18. Is this the correct way to construct an array to pass to my shader that I can then reference and use in the fragment shader? var textureBank = new Array(); var textureLocations = [ //ZONE 1: "./textures/Beach_Rocks.jpg",//BASE "./textures/Sand_2.jpg",//Angle Zone 1 "./textures/Sand_2.jpg",//Angle Zone 2 "./textures/Sand_1.jpg",//Angle Zone 3 "./textures/Rocks_2.jpg",//Angle Zone 4 ]; $.each(textureLocations, function(i,e){ textureBank.push(new BABYLON.Texture(e, scene)); textureBank[i].wrapU = BABYLON.Texture.CLAMP_ADDRESSMODE; textureBank[i].wrapV = BABYLON.Texture.CLAMP_ADDRESSMODE; }); teriableBasic = new BABYLON.ShaderMaterial("teriableBasic", scene, { vertex: "teriableBasic", fragment: "teriableBasic", }, { attributes: ["position", "normal", "uv"], uniforms: ["world", "worldView", "worldViewProjection", "view", "projection"] }); teriableBasic.setTexture("textureBank", textureBank); Now how do I reference and use it in the shader? "uniform sampler2D textureBank;\r\n"+ is the line im using, but before I even run it Im like 90% sure it will drop and error, because textureBank is and array... Do I have to set texture to each of those textures in my array to sample from them?
  19. Man I can not believe the rapid pace you guys are pushing changes to the engine, it's pretty impressive. Im starting to feel like things are falling between the gaps now though, like if your not constantly just reading posts it seems a lot of things get missed. I know the guys are constantly working on the documentation and things are always going to be changes, but I guess my point is BJS is starting to look scary from a outside perspective. i tried to get my buddy set up over the phone and he's decent at computers but gave up really fast because it was just too much he felt like, and that was not the only person. I'm not saying too much as in the learning curve actually I'm not too sure what put him off from it I'll have to ask. but it made me think that if outsiders are thinking it's scary, and guys who are in the loop like myself are having trouble keeping up with what's really good or not with convention and logic structure that's best suited for the most recent version of Babylon. Then maybe we as a community need to discuss how to present things differently or figure where the disconnect is happening? Or maybe I'm just out of the loop now? But really I honestly feel like we are losing continuity.
  20. Yea I want to solve this let me make a PG that can demonstrate it l and we'll start from there? I'm super busy today, but if I get a moment I'm on it.
  21. Not complaining just saying I'd love to see how someone solved it. And losing the client was nothing to worry about I have more . I would actually like to message you @RaananW if you think it's a fixable bug. It was really hard to troubleshoot because not all browsers would produce the error. and yes it is on topic seeing how I responded directly to a quote from this thread....
  22. God yes, I lost a paying client over this bug....
  23. i personally think TS is a flash In a pan and will never become standard... but if others feel different that's on them. If it works for you it works for you, but maybe y'all should consider calling this babylonTS now as to not falsely advertise. I am a huge fan boy of vanillaJS though so my opinion has some bias.
  24. cloth

    Sps system might be able to pull off cloth. One of my projects I wanted to do was soft body simulations in real time but have had like no time to work any any "want" projects... let me know what you dig up in this area there would be a few ways to accomplish this.
  25. I have beat this document and others into the ground trying to get fog to work on a custom shader... Does anyone have a working GLSL example not in typescript but like a actual BABYLON.Effect.ShadersStore version. I have been hitting my head against a wall trying to get this to work and the more I dig the more confused I am getting because it seems like everyone variables and uniforms are called different things and do not follow any sort of convention from example to example...