Jump to content

Search the Community

Showing results for tags 'polygonmeshbuilder'.

  • 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 6 results

  1. Can anyone explain what I am seeing here? https://www.babylonjs-playground.com/#PTTMVI#68 The polygon seems fine. The hole seems fine. When put together, a mystery occurs. I have been reversing and converting arrays until I am basically blind but I cannot shake this phenomenon. Lil help please!
  2. Hello everybody :-) I'm trying to use ExtrudeShape for creating a building shape and am having trouble with the cap. I understand that the cap is not tessellated (triangulated) so it would be faster. But when I have concave angles in the shape, it doesn't look good. I also tried using Ribbon for the roof polygon somehow, but the tessellation doesn't happen here either of course. Here is my code: http://www.babylonjs-playground.com/#1KQZAF#0 I tried using PolygonMeshBuilder but the mesh is rotated the way I don't want it to and some walls keep dissapearing depending on the angle of view: http://www.babylonjs-playground.com/#SJLOW#1 I don't need the mesh to be updated so the speed of tessellation doesn't bother me much. What am I doing wrong? What can I do to have a tessellated building? Thanks :-)
  3. After my last excursion into building a house with BJS the corners bugged me a little as they were basically different wall butted together with one edge showing. Also you had to make individual walls and place them correctly. Plans for a house are often shown as just a floor plan so I began to wonder if I could build a house from a floor plan. At this stage just taking a plan and entering measurement as data into the floor plan builder. This is the result http://www.babylonjs-playground.com/#4GBWI5#2 You can read how to use the buildFromPlan function here http://babylonjsguide.github.io/gamelets/House#the-function-and-how-to-use-it and there are more details about its construction. One thing I have yet to fully write about is setting the interior and exterior textures and colors but this uses the same method as Jerome's faceUV and faceColors method but instead of an array being needed there a just two parameters to set. The other main point about the uvs is that I have set them so that they are scaled according the width of the wall. If the width of the longest wall is 1 and there is a wall of half this length then only half the texture image is used for this wall. In other words if the texture is stripes and the longest wall is covered by 20 vertical stripes then the half sized wall will be covered by 10 vertical stripes. Who knows perhaps I will tackle roofs next.
  4. Back in 2015 this PG produced a visible mesh http://www.babylonjs-playground.com/#1TGOMH#3 but does not in 2.5 or 3. Using the debug layer it seems to exist and has a boundingbox.
  5. Hi everyone, I am using the PolygonMeshBuilder to extrude a 2D shape with holes. However, the `build` function extrudes the shape down by default... but I want it to extrude up .... Is there a way to switch the extrusion direction when building the mesh ? For now I am flipping the mesh manually as I did not found another way. mesh.scaling.y *= -1; mesh.flipFaces(); Here is the playground: http://www.babylonjs-playground.com/#1ZAXRO#0 Thanks
  6. Hello! I'm having trouble figuring out the how to map specific parts of a larger image to specific polygons forming a complex shape created by through the PolygonMeshBuilder. After hours of researching the problem and finding only similar answers that either don't, or I can't figure out how to, apply to my specific situation, I'm turning to asking directly for help. I was given code that generates a map of the US, where each state is a separate object generated from an XML file using the PolygonMeshBuilder class. The assignment is to take a provided image displaying a map of the entire US, and have each state object pull it's specific portion of the map image to texture it. $.each(polys, function( index, value ) { var pts = $(this).find('outerBoundaryIs').find('LinearRing'). find('coordinates').text().replace(/,0 /g," ").replace(/,/g, " "); var groundMat = new BABYLON.StandardMaterial("red", scene); groundMat.diffuseTexture = new BABYLON.Texture("usa-physical-map2.jpg", scene); groundMat.specularColor = new BABYLON.Color3.Black(); var ground = new BABYLON.PolygonMeshBuilder(stName + "_" + index, BABYLON.Polygon.Parse(pts), scene).build(); ground.parent = state; ground.material = groundMat; //ground.material = new BABYLON.StandardMaterial("red", scene); //ground.material.diffuseTexture = new BABYLON.Texture("usa-physical-map2.jpg", scene); var ptCoords = ground.getVerticesData(BABYLON.VertexBuffer.PositionKind); console.log("ptCoords: " + ptCoords); var tCoords = ground.getVerticesData(BABYLON.VertexBuffer.UVKind); console.log("tCoords: " + tCoords);This is the relevant code that generates the ground of the state which is what is drawn to the scene. I've added some bits in effort to complete the task, but so far all I can achieve is displaying the whole (or as much fits on the state) map on each state. I am able to pull the coordinates of where each map cutout should be, but I cannot figure out how to take that information and actually apply it to a polygon in the object. Thank you in advance for your assistance.
×
×
  • Create New...