Search the Community

Showing results for tags 'vertex'.

More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


  • HTML5 Game Coding
    • News
    • Game Showcase
    • Coding and Game Design
  • Frameworks
    • Phaser
    • Pixi.js
    • Babylon.js
    • Panda.js
    • melonJS
    • Haxe JS
    • Kiwi.js
  • General
    • General Talk
  • Business
    • Collaborations (un-paid)
    • Jobs (Hiring and Freelance)
    • Services Offered

Found 10 results

  1. function addSphere(scene, { x, y, z }: Object, diameter: number = 0.05, color = new BABYLON.Color3(0, 0, 0)) { const sphere = BABYLON.MeshBuilder.CreateSphere("sphere", { diameter }, scene); const material = new BABYLON.StandardMaterial("texture1", scene); material.diffuseColor = color; sphere.position = new BABYLON.Vector3(x, y, z); sphere.material = material; } const positions = mesh.getVerticesData(BABYLON.VertexBuffer.PositionKind); const zeroCoord = { x: positions[0], y: positions[1], z: positions[2], }; addSphere(scene, zeroCoord, 1); Demo As you can see in the code, I am just trying to get vertices of the foot. and the placing a sphere on the first vertice of the foot. But for some reason, as can be seen in demo, the sphere is added somewhere not even remotely close of the foot. You can download the mesh here. Why is this happening ? I've been trying to fix this for two days now, but I can't seem to do it. Edit: I am using babylonjs exported for blender. Edit2: Added playground url
  2. Shader translation

    Hi, I need help with shaders in pixi . I trying to translate and rotate sprite with shaders. I am using PIXI.Filter but I can find any example with vertex shaders(only fragmet examples ). If someone can provide some example . Thanks
  3. Apply Texture to Vertex

    Are there any examples of how to apply a texture to an individual vertex as is described in this tutorial:
  4. Hello everybody! I'd like to create a terrain that is moving in cycle generated from height map in effective way. I created mesh with new BABYLON.Mesh.CreateGroundFromHeightMap('ground', "", 200, 200, 50, -20, 20, scene, true); So I have 200x200 plane with 50 subdivisions. Then I registered before render function in which I take first 51*3 points (51 vertices, cause there is 51*51 vertices) and put it at the end of position array of vertices data of mesh. So it should move the terrain in the cycle, but maybe I'm doing something wrong. Here is my playground: . I achived something like this here: but I don't think it's effective way.
  5. I've read the code written by the awesome @Temechon, which addresses modifying the vertices in a mesh. However, I don't understand exactly how to create one such mesh from scratch, especially in such a way that it can be updated frequently with new vertex data. Could someone explain that more clearly? (Also, does BabylonJS have a way to use a VBO for such a task?) I'd post example code, but I don't really have anything that even begins to work yet. EDIT: Clarification. I know the logic and steps needed to create a mesh using vertices and the like. What I don't know is how one applies the arrays to the mesh itself, or how to create the mesh so the vertices can be updated.
  6. Hello fellow BabylonJS users, I'm currently using babylon to put some product visualizations on the web, but today I ran into a problem that I didn't find to be documented anywhere. I got a poly-reduced CAD-data rip with custom vertex normals, in Blender everything looks nice and smooth, but when I export to babylon, all those data seemsto be lost. Do you have any idea how to fix this? I'll attach an image, showing the dataloss. Have a nice day, J
  7. Hi, I am a novice on Babylon. I explain my problem, I created a plane with some vertices with Blender and then I export it in Babylon.What give us this, a grid of vertices (vertices ? i'm not sure if it is called vertices, vertex, intersections, dots, or other name) : I want to create an animation which make the vertice move. (An animation on a vertice, not on the all mesh) I can get an array including all the position of each vertices (x, y, z) : [0.8603,0,0.8436,1,0,0.75,1,0,1,-0.0401,0,0.8269,0,0,1,-0.25,0,1,-0.25,0,-0.25,0,0,-0.25,-0.0702,0,-0.1036,0.6698,0,-0.2934,1,0,-0.25,1,0,0,0.3603,0,-0.1564,0.5,0,-0.25,0.5969,0,0.0835,0.4031,0,-0.6832,0.5,0,-0.5,0.3068,0,-0.5568,1,0,-0.75,1,0,-0.5,0.6598,0,-0.6905,-0.613,0,-0.1865,-0.5468,0,-0.3636,-0.5,0,0,-0.6531,0,-0.6665,-0.6103,0,-0.8402,-0.5,0,-0.5,-0.1003,0,-0.6731,-0.0501,0,-0.4198,-0.25,0,-0.5,-0.5,0,0.75,-0.5,0,1,-0.75,0,1,-0.4165,0,0.3035,-0.5501,0,0.5802,-0.75,0,0.5,-0.1404,0,0.1798,0,0,0.5,-0.25,0,0.5,0.4031,0,0.8168,0.5,0,1,0.25,0,1,0.5,0,0.25,0.5,0,0.5,0.2934,0,0.4131,0.8736,0,0.3904,1,0,0.25,1,0,0.5,0.6497,0,0.5769,0.75,0,0.0936,0.1531,0,0.3168,0.25,0,0,0.25,0,0.75,-0.3703,0,0.3035,-0.2066,0,-0.0869,-1,0,0.25,-0.8202,0,0.1464,-1,0,0,-0.75,0,0.0936,-1,0,0.75,-0.6932,0,0.6932,-0.2901,0,-0.6731,-0.5,0,-1,-0.25,0,-1,0,0,-1,-1,0,-0.75,-0.8603,0,-0.5902,-0.75,0,-1,-1,0,-0.25,0.75,0,-0.887,0.5,0,-1,0.75,0,-1,1,0,-1,0.1999,0,-0.7934,0.25,0,-1,-0.1932,0,0.6932,0.75,0,1,-1,0,0.5,-1,0,1,-1,0,-0.5,-1,0,-1] I know it is possible to extract the 3 coordinates of each vertice to create a vector3 for exemple. But I don't know how to make the animation. The animations seem working only on Mesh, but not on vectors, vertice or others. I have the idea to create 2 planes. The first with the initials coordinates of the vertices. The second plane with modified coordinates.And then, create an interpolation between the both plane, but I don't know how to do that. Can you help me ? Thanks
  8. Blender Export Issues

    Hi, I am attempting to export a blender file using the babylon.js exporter. My mesh contains an armature with incomplete and basic rigging, during my attempts to export the following situations occur: 1. processing complete of skeleton: Armature processing begun of mesh: characterWARNING: Maximum # of influencers exceeded for a vertex, extras ignored^repeated many many times 2. num positions : 65535num normals : 65535num uvs : 131070num uvs2 : 0num colors : 0num indices : 65535num skeletonWeights: 262140num skeletonIndices: 262140WARNING: The following mesh has exceeded the maximum # of vertex elements & will be broken into multiple Babylon meshes: character========= An error was encountered ========= File "C:\Program Files\Blender Foundation\Blender\2.72\scripts\addons\", line 247, in execute mesh = Mesh(object, scene, self.multiMaterials, nextStartFace, forcedParent, nameID) File "C:\Program Files\Blender Foundation\Blender\2.72\scripts\addons\", line 491, in __init__ = + nameIDERROR: Can't convert 'int' object to str implicitly========= end of processing ========= These two errors prevent me from exporting my man into babylon. Any advice as to how to proceed would be greatly appreciated, Thanks Joe
  9. Vertex Attributes

    hello there, since this is my first post: kudos to deltakosh et al for this great work. my question is, how can i add custom attributes (buffers) to my shaders? it seems like normals, positions and uv's just magically surface when needed - yes, they're quite cleverly integrated and hidden from the developer. now i know i can cheat the system and use for example normals to send additional data to my vertex shader... but then i can't use the normal data for their original purpose anymore =p i don't want to read and understand the source code... because that is not what you're supposed to do when using a framework. if i wanted to do that, i would write my own low level framework. and -- for the life of me i can't find the info from the documentation. can anyone at least point me to the right direction?