Jump to content

Search the Community

Showing results for tags 'vertices'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


  • HTML5 Game Coding
    • News
    • Game Showcase
    • Facebook Instant Games
    • Web Gaming Standards
    • Coding and Game Design
  • Frameworks
    • Phaser 3
    • Phaser 2
    • Pixi.js
    • Babylon.js
    • Panda 2
    • melonJS
  • General
    • General Talk
  • Business
    • Collaborations (un-paid)
    • Jobs (Hiring and Freelance)
    • Services Offered

Find results in...

Find results that contain...

Date Created

  • Start


Last Updated

  • Start


Filter by number of...


  • Start



Website URL





Found 22 results

  1. Hi All, Do you have any idea how I can select edges/vertices on mouse over? http://www.babylonjs-playground.com/#35HAW1 I appreciate your time and effort to help me out. Arte
  2. I have an OBJ that starts like this: v -212.947922 761.461914 28.203093 v -213.405563 766.404602 28.193245 v -214.460007 771.238403 28.648092 v -214.639648 776.197327 28.477924 v -215.033905 781.149658 28.498495 v -215.717438 786.059753 28.729038 I copied the vertices to an array using mesh.getVerticesData(BABYLON.VertexBuffer.PositionKind) When I look at vertices[0] I expected to get -212.947922 (the first value in the OBJ file) but it comes up with a value that's somewhere else in the OBJ file. How can I map a value from getVerticesData() to a location in the OBJ file? So fo
  3. Hi !, I'm looking at how vertices work so that I can work with and transform my mesh later. For that I started with a simple box to find the order and give a number on the vertices group. Can someone explain to me why numbers 3 and 7 are in the same place? https://playground.babylonjs.com/#3CZLNK Thank you !
  4. Hello, noob back Just wanted to ask what may be the best way to approach creating something like a maze from 2D positional data. (Image below to show what im trying to accomplish) I had created something by creating custom meshes which mapped to 2D data but even creating 7 or so planes makes the performance extremely slow. I'm guessing this has something to do with computing normals or creating new vertex data... Not sure. So far each of the custom planes you see below are cloned from a base custom mesh object and then a new vertexData is created for each one based on the XY coordi
  5. Hey crew. I've run up against trouble trying to move the vertices of an imported mesh. (So far I've tried a .babylon file and .glb.) Here's a Playground example where I've added a randomize-vertex-positions function to the glTF Importer (Boombox) example. Upon loading the scene file, we do this: //Add a "do this once the mesh loads" function to the example: var bb = scene.getMeshByName("BoomBox"); //Get the newly-loaded mesh bb.updateable = true; //Not clear if this does anything var positions = bb.getVerticesData(BABYLON.VertexBuffer.PositionKind); //Co
  6. I'm new to BabylonJS. I've been successful at integrating the framework within an Angular 2 project. Now, I'm trying to integrate 3D models from the Unity Asset Store. I used the Unity exporter to generate a .babylon file. It rendered a gray beagle. The console complained about an old PBR Material version. I removed the albedo property and the error went away. So, did my beagle. I've attached my log from the console. I'm not sure where to start troubleshooting. What is the common approach to integrate 3D models into Babylonjs? Is there some linting tool to troubleshoot t
  7. As far as I understand, updating the positions data on a mesh using updateMeshPositions - or other update* functions - only works when the mesh is set to be updateable. This setting can only be done at creation time. All basic shape creation* functions have the updateable option that can be set, but the standard mesh constructor has not. How do I make a custom shaped mesh updatable? I have thought of a workaround, by creating an updateable cube or something and replacing the vertices data with my custom mesh data. I have not tested this, but I will. And another question:
  8. The following functionality applies the current vertices' positions to the same vertices(No change to the mesh). var arr = mesh.getVerticesData(BABYLON.VertexBuffer.PositionKind); for (var i = 0; i <mesh.getTotalVertices(); i = i++){ var fx = arr[i * 3 + 0]; var fy = arr[i * 3 + 1]; var fz = arr[i * 3 + 2]; arr[i * 3 + 0] = fx; arr[i * 3 + 1] = fy; arr[i * 3 + 2] = fz; } mesh.setVerticesData(BABYLON.VertexBuffer.PositionKind, arr); I'm unsure as to how to apply a random noise, that still t
  9. Hi, I'm running into an issue regarding collision detection against adjacent DisplayObjects. Let's say I have sibling objects that are a child of a Container that has been rotated. If I use getBounds() on the siblings they return a bounding box that is oriented to cardinal north. Using those bounds for collision detection may result in false positives, because the given bounds may not follow the actual shape and orientation of the DisplayObject. I created a codepen to illustrate the point: When you toggle the "rotate" buttons at the bottom of the pen you will see the purple box morp
  10. I've been searching if babylonjs has the ability to reduce a mesh vertices and triangles
  11. Hola! I have a collection of vertices in 3ds max that i would like to export for babylon with a few other meshes. The exporter shows an error, it likely thinks my vertices are useless. These are meant to be potential camera positions, but i am using a babylon camera and not exporting a 3ds max cam. Any suggestions are appreciated.
  12. @jerome, love your new function getFacetData as introduced below and when you have finished any tweaking IMHO would be a great addition couldn't help playing around with it and adding a method of setting a color for an individual facet, http://www.babylonjs-playground.com/#1CRS0Z
  13. The following function minimizes the number of vertices in a mesh. BABYLON.Mesh.prototype.minimizeVertices = function() { var _pdata = this.getVerticesData(BABYLON.VertexBuffer.PositionKind); var _ndata = this.getVerticesData(BABYLON.VertexBuffer.NormalKind); var _idata = this.getIndices(); var _newPdata = []; //new positions array var _newIdata =[]; //new indices array var _mapPtr =0; // new index; var _uniquePositions = []; // unique vertex positions for(var _i=0; _i<_idata.length; _i+=3) { var _facet = [_idata[_i], _idata[_i + 1], _idata[_i+2]]; //facet ver
  14. Hi guys how can I get geometry vertices , in three.js i can get positions with box.geometry.vertices and returns coordinate for 8 points ( of a box ) ; now via Bjs i tried to use box.getVerticesData(BABYLON.VertexBuffer.PositionKind); , but seems returns 24 points ! am I wrong or Babylon js use duplicate/separate vertices for each face ! if so , how can I avoid to return duplicated coordinate ? thanks in advance .
  15. Hello, I want to update the vertices of a lines mesh after it has been created. On a sphere, by contrast, I can do so fairly simply: mySphere.position.x = myX; mySphere.position.z = myZ; But there does not appear to be anything like that for lines mesh: // myLines.positions is undefined ???? myLines.positions[0].x = myPositions[0].x; myLines.positions[0].z = myPositions[0].z; myLines.positions[1].x = myPositions[1].x; myLines.positions[1].z = myPositions[1].z; // myLines._positions is null ???? myLines._positions[0].x = myPositions[0].x; myLines._positions[0].z = myPositions[0]
  16. Hey guys, I want to edit the loading Object in the following code. I want to rotate it or to set the vertices and normals. I tried it with "this" . BABYLON.SceneLoader.Load(document.getElementById("path").value, document.getElementById("name").value, engine, function (scene) { // Ground var ground = BABYLON.Mesh.CreateGround("ground", 15,15, 1, scene, false); var groundMaterial = new BABYLON.StandardMaterial("ground", scene); groundMaterial.specularColor = BABYLON.Color3.Black();
  17. Hi, How can I retrive heightmap vertices? I tried with the following: var Positions = ground.getVerticesData(BABYLON.VertexBuffer.PositionKind); It returns null. Is there a speical way to get all the vertices from my height map?
  18. Hello, I am quite new to Babylon JS. I was wondering if there is a way to morph the selected vertices on click. I read the documentation, and tried all their examples, but have yet to come up with a solution. So far I have this code below. scene.onPointerDown = function(evt, pickResult) { if (pickResult.hit) { // code for mophing selected vertices here. var chosenMesh = pickResult.pickedMesh; } } I am stuck right at this point. I did some console logs and chosen mesh seems to select the entire plane. I also tried pickResult.faceId and it gives me the Id of the se
  19. Hi there, I just started learning BabylonJS some days ago (and I love it so far), but I'm having an issue. I am loading scenes, with a plane called WaterPlane, which is... The water plane. I am using some shaders to simulate water surface on it, however, as it only has 4 vertices, the vertex shader is not really useful... So I decided to convert it to a GroundMesh (which has more vertices), the only issue I am getting is regarding the size of the WaterPlane, I can't use the scaling data as it makes a huge water surface... I've spent some time looking on the internet, how I could get the sc
  20. I'm a JS developer using Babylon.js for the first time, and right now I'm just trying develop an understanding of what is happening under the hood. I've been programming forever, but have limited 3D experience, so Babylon.js looks like a perfect learning opportunity. I put together a simple program that takes a mesh, finds the screen coordinates of each of its vertices, and overlays triangles on a canvas on top of Babylon.js's renderCanvas. I'm getting some strange results, though. Most of the vertices are right where they should be, but others are completely wrong. When I do this with a cub
  21. I've got a fairly good understanding of how meshes keep track of their vertices, but how do they store data associated with faces? I've been searching through the documentation and digging into the mesh object locally, but I'm not understanding this yet. Are faces stored in a separate array, or is there an array that stores edge connections between vertices? How are faces stored and rendered? I've been able to extract screen coordinates for each vertex of a moving mesh, but I'm hoping to understand how that is turned into triangles during rendering. Thanks!
  22. This code: this.mesh.setVerticesData(BABYLON.VertexBuffer.PositionKind, positions, true); this.mesh.setVerticesData(BABYLON.VertexBuffer.NormalKind, normals, true); this.mesh.setVerticesData(BABYLON.VertexBuffer.UVKind, uvs, true); this.mesh.setIndices(indices); Does work with Internet Explorer, and doesn't work with Chrome. When I say doesn't work I mean the mesh doesn't appear in the scene. It happened when I updated to the latest beta version. In previous version I worked with (where the setVerticesData had the signature (number[], string, boolean) instead of
  • Create New...