Jump to content

Search the Community

Showing results for tags 'merge'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • HTML5 Game Coding
    • News
    • Game Showcase
    • Facebook Instant Games
    • Web Gaming Standards
    • Coding and Game Design
    • Paid Promotion (Buy Banner)
  • Frameworks
    • Pixi.js
    • Phaser 3
    • Phaser 2
    • Babylon.js
    • Panda 2
    • melonJS
    • Haxe JS
    • Kiwi.js
  • General
    • General Talk
    • GameMonetize
  • Business
    • Collaborations (un-paid)
    • Jobs (Hiring and Freelance)
    • Services Offered
    • Marketplace (Sell Apps, Websites, Games)

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Website URL


Twitter


Skype


Location


Interests

Found 11 results

  1. I am getting the error: "Cannot merge vertex data that do not have the same set of attributes." when I try to merge a BABYLON.Mesh created using Vertex data with ones created with MeshBuilder. What attributes are different/am I missing? https://playground.babylonjs.com/#AGL702 (Line 26) Thanks
  2. Hello to all of you. First of all I want to explain what I do. I am building location by passing Vertexes and name of the location(PolygonMeshBuilder for location and material for it). Then I add this specific location into array, remove it from the scene at end and shortly afterwards I merge it. With them I do not have any problems whatsoever. However I do have horrendous performance issues with location names. Here I am using the following steps: -new DynamicTexture => drawText on it =>new StandardTexture=> diffuseTexture and opacityTexture taking previously created dynamicTexture. Shortly afterwards I apply it to a new PolygonMeshBuilder method that again takes objects. I was hoping that I will mitigate it too by merging meshes but I was wrong. The same number is replicated all over again in various axes. Where is my probable mistake? Thanks
  3. Hi everyone hope you doing great ! I'm doing a project where I want to create complex objects from more simple or "atomic" ones. For example, I create a vertical rectangle and a horizontal rectangle, I merge them and I have a "L" shape. But when I try to merge my "L" shape with another rectangle to make a "U" for example it doesn't work :/ My question is : is there any way to do what I want to do or am I stuck with only one level of merging ? Thanks a lot for your time
  4. If I merge meshes using the Mesh.MergeMeshes() function I get a merged mesh whose "center" / "origin" is located at world location (0,0,0). I would like to change this "center" to the center of its bounding box. How do I do this?
  5. hi, I've build a simple example: http://www.babylonjs-playground.com/#1RSDU1#0 Please enable line 37 to merge the two meshes of the spheres to a new mesh. By that, the global positions of the spheres are "forgotton" and only the local positions relative to their parent are respected. Can anybody tell me how to use the global coordinates of the single meshes?
  6. I have recently started on a Babylon project, and I have been wanting to create a capsule physics impostor for my game. I found a test demo for Oimo.js that basically achieves what I want: compound test (capsule). There are two problems: 1. due to some shortcomings in Oimo, I have had to switch to Cannon.js. 2. the demo uses Three.js and I'm sure how to exactly translate that into Babylon. I basically want to be able to combine two sphere impostors with a cylinder impostor. I'm not sure what is the best method for this, there are only a few examples that I have found, and I haven't found anything in the docs. So I created an example to show what I am talking about: capsule sandbox. I have created the capsule mesh, but I just need to figure out how to add a capsule impostor. Thanks.
  7. Hey guy Is there any way can combine multiple bitmapdatas into one?
  8. Shaders are still new to me, so this might be a silly question: Is it possible to chain, or merge shaders? I've got a PBRMaterial which uses the ColorCurves, and a custom shader that generates a texture. I'd love to be able to be able to combine or chain them, so I can have both effects. My initial thought was: 'grab the PBRMaterial and Shader from github, and hack in the properties/functions from my custom shader'. But those files have ~2000 lines of code in them, so if anyone knows an easier approach I'd be grateful. Pseudo code, because one can never be too clear What I've got: ... var mesh = new Mesh(); var materialA = new BABYLON.PBRMaterial("pbrMat", scene); var curve = new BABYLON.ColorCurves(); curve.GlobalHue = 250; materialA.cameraColorCurves = curve; var materialB = new BABYLON.ShaderMaterial("otherMat", scene, "./assets/shaders/otherMat", { attributes: ["position", "uv"], uniforms: ["worldViewProjection", "attribute"] }); materialB.setFloat("attribute", someVar); mesh.material = materialA; // or materialB.. but not both ... What I'd want: var mesh = new Mesh(); var materialA = new BABYLON.PBRMaterial("pbrMat", scene); var materialB = new BABYLON.ShaderMaterial("otherMath", scene, "./assets/shaders/specialMat"); mesh.material.Add([materialA, materialB]); // or mesh.material = materialA.chain(materialB); Thanks for your time!
  9. Hello everybody ! I've got a question about boundingspheres. I want to set my camera to an appropriate distance from my meshes to see all of them in my frucstrum. I tried the code below, it's working if boudingspheres of my meshes are not too far or if there is just one mesh. I want it to work for every meshes importation, so I have to merge my boundingspheres but I don't know how to do it. for (let i = 0; i < newScene.meshes.length; i++) { test = newScene.meshes.getBoundingInfo().boundingSphere; camsum += test.radius / Math.sin(this.camera.fov / 2); } let camaverage = camsum / newScene.meshes.length; this.camera.radius = camaverage; Some advices ? Thanks for your time ! DeathSoul
  10. Hi, I'm currently doing heavy optimization work, and having a great time (kidding). Bringing the draw call count down etc. As such, merging meshes for static geometry is an absolute necessity. There is an 'old' tutorial about that here, but I figured I'd try the modern way which is using Mesh.MergeMeshes. It didn't give me immediately expected behaviour: 1/ I realized I was trying to merge cloned meshes, and BJS made the browser freeze since it basically tried to merge an array with itself. I fixed the problem by using makeGeometryUnique on the meshes before merging, but that is kind of counter-intuitive (also there's a small bug on Geometry.clone() so it won't work that way in the playground either, but I've fixed this one locally). 2/ I've also found I needed to force a new computation of the meshes' world matrices before doing the merging. Again, this is kind of counter-intuitive and may lead to a lot of head banging on wall (it did with me). These issues are illustrated in this playground: http://www.babylonjs-playground.com/#2FQOTS Is this behaviour intentional/acceptable? If the answer is no, I'll gladly work on a PR to fix it. Otherwise, I guess this could all be explained in the documentation (which needs updating anyway).
  11. Hi, Thanks Deltakosh for your wiki page about merging meshes (https://github.com/BabylonJS/Babylon.js/wiki/How-to-merge-meshes). It helped me to create a function to merge a mesh to another one. I added the function to your Mesh class and I could send you a pull-request if you want. Nevertheless I'm not totaly happy about it since I didn't manage to avoid to create a new mesh to contain the result of the merging. Indeed, I think it could be helpful to directly modify the first mesh to be the merged mesh, thus the process could be simpler to chain meshes merging (and I need this ) and more efficient. Here are two jsfiddles. The first one gives the good result but a new mesh has to be created, the second one avoids the creation of a new mesh but the result is translated and I don't understand why. http://jsfiddle.net/MaxenceBrasselet/epzrV/ http://jsfiddle.net/MaxenceBrasselet/epzrV/1/ (only two lines are different: l48 and l65)
×
×
  • Create New...