Jump to content

Search the Community

Showing results for tags 'geometry'.

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

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Website URL


Twitter


Skype


Location


Interests

  1. Hi, I just joined this form and am very new to the webgl development, so my apologies in advance if this is a question that does not really make sense. I am currently trying to use PIXI.js with a third party data visualization library. One of the classes in this third party library provides a way to customize the way it renders graphics. In the sample application, they do this by writing a raw webgl but I would love to do this using PIXI.js if possible. This class passes webgl context (this.context) so we can do something like below. const gl = this.context; // webgl contex
  2. I'm trying to create a mesh that consists of a few dozen triangles that are going to change every frame (hopefully performs okay....) How do I actually do that though? Create mesh: const shader = Shader.from(vertexSrc, fragSrc) const geometry = new Geometry() .addAttribute('aVertexPosition', [initialVerts]) .addAttribute('aVertexColor', [initialColors]) const mesh = new Mesh(geometry, shader, null, DRAW_MODES.TRIANGLES) Attempt at changing aVertexPosition and aVertexColor each frame: mesh.geometry.addAttribute('aVertexPosition', newVertices) mesh.geometry.addAttr
  3. I have created a BoxGeometry and then added it to a Mesh. The problem is that no matter what size a give it, it always gets rendered as size=1. I also created a box using BABYLON.MeshBuilder.CreateBox(), and there it works fine, size is updated as expected. Here's the PG: http://playground.babylonjs.com/#UUJWXS Problem is at line 14: var box = new BABYLON.BoxGeometry('box', scene, 8, true, mesh, 4); as you can see size is set to 8, but actually it gets rendered smaller the the other box which has size 4.
  4. I've created a BoxGeometry and assigned it to a Mesh, then when I click on the Mesh I would like to trigger an update of the geometry, for example change its "size" parameter. Is there a method I need to call on the Mesh to update it? I can see that the size property of the geometry gets updated, but the Mesh is still using the cached version. This is probably an easy thing to do, but I'm struggling a bit as I'm very new to Babylon. I've created a PG here: http://www.babylonjs-playground.com/#JTA9RH Any help would be much appreciated
  5. Hi there, I'm new to Babylon.js. I was wondering if it's possible to create quad-based geometry in Babylon, or if there's a workaround. From the docs I don't see this possible, but maybe you have some hints I need to create a simple 3D modeling editor, where the user should be able to select geometry faces, better if they're quads.
  6. Does anyone know how I can get the Matter physics engine to render its geometry when running within Phaser? I.e. when I'm not assigning a sprite to a physics body, but I want the geometry of the objects I've created to be rendered as lines instead. If I set "debug" to true on the Matter config, I can see purple lines being rendered by the debugger. But if I set debug to false, I no longer see anything rendered. I've found there are a bunch of properties on the Matter "Body" object like StrokeStyle, LineWidth and FillStyle (described here) which seem designed for this purpose. However
  7. Hi everyone, I know it's possible and advised to use InstancedMesh when several meshes share the same geometry and the same material. Is there some recommended optimization to do when two meshes share the same geometry but have different materials ? For example with this case : http://playground.babylonjs.com/#T4Z2V9#1 (here VertexData object is already loaded) Is there something better than two calls to "applyToMesh" ? Like obj1.geometry = obj2.geometry, this kind of thing... (my question is based on the fact that Unity explicitly share the same geometry across
  8. Greetings! I had an idea for the organization to move the camera when the cursor to a specific side of the screen, for example - have brought the cursor to the top of the screen, the camera moves up. Brought down - the camera moves down. But I do not know how to organize it. There is another problem with importing models from 3ds Max 2015 models do not rotate absolutely nothing, no one axis. Tried already and simple rotation, and rotation directly in 3ds Max. Even tried to change the angle of the file .babylon. Nothing changes. Blender model of spin, but their appearance does not suit me, th
  9. Hi, I'm loading two mesh, one T-shirt and one shorts, some parts of T-shirt goes through the shorts, so I'm trying to update T-shirt vertices where there is intersection point with the shorts, and make a small expansion of these, But when I do this, it's as if my t-shirt mesh is broken. PR:http://www.babylonjs-playground.com/#RQ90T
  10. Hi there! OK, so I just figured out how to draw shapes with the graphics object. But, I wonder why this method exist ?!?! line = new Phaser.Line(100, 100, 200, 200); ... and then it gets positioned on update() But a line, never gets rendered Does this mean that, this method "Phaser.Line()" is useless ?!?!?!
  11. Hi people, As this has been requested from time to time on this forum, here is a simple and fast method for computing any mesh area : var area = function(mesh) { if (!mesh) { return 0.0; } var indices = mesh.getIndices(); var positions = mesh.getVerticesData(BABYLON.VertexBuffer.PositionKind); var v1x = 0.0; var v1y = 0.0; var v1z = 0.0; var v2x = 0.0; var v2y = 0.0; var v2z = 0.0; var crossx = 0.0; var crossy = 0.0; var crossz = 0.0; var ar = 0.0; va
  12. So, circles are confounding me today... About twenty years ago I did GCSE maths and remember wondering when or why I would ever need to know any of this stuff about circles and angles and the like. Now. Now is when I need to know all that stuff. So I've been all over the interwebz and have learned lots about circles, but while there are myriad explainations of how to work out the length of an arc, the angle and area of a sector... and use both radians and degrees to calculate same; I can find nothing that will tell me which sector a given value (theta, radian, degree, whatever) is in.
  13. I was wondering since I have a chunked (tiled) based terrain system, I have a height tool made now, but at the edge of each tile I have gaps forming, I have seen somewhere a way that this can be fixed but hours of searching I haven't been able to find it and I seem to forgotten to bookmark it.. so hoping for some pointers here on possible ways this can be achieved. I attached a image to show what is happening between chunks (meshes). Thanks! Edit: Found the article and it has to deal with Three.js so not at all useful for me..
  14. BABYLON.SceneSerializer.SerializeMesh isn't including the most important bit for meshes, the geometry! I make a cube and then use BABYLON.SceneSerializer.SerializeMesh(cube) and output to console, sure enough no geometry, thus when I use the importer it spits out no geometry found warning.. var thebox = BABYLON.Mesh.CreateBox("thebox", 10, scene); thebox.position.x=thebox.position.z=112; thebox.position.y=5; thebox.id='thebox'; thebox.receiveShadows = true; var box = BABYLON.SceneSerializer.SerializeMesh(thebox); That is all I use, shouldn't the geometry be included in the output
  15. 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 .
  16. 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 th
  17. Hello In some cases, its more efficient to compute models in real time, rather then download the provided geometry in a babylon file. I want to create markers in my room, terrain ...and replace this specific spots with something like a trees currently i have to create a separate mesh as marker, it would save some space, if i could simply define a marker as a different material Thank you all very much, whoever wants to contribute The playground http://babylonjs-playground.com/#22TZPO#1
  18. hi do you know any tools to generate 2d mesh from geometry or Points like following image? i wanna create navmesh data from tiled tool. but i can't find good tool to generate from tiled data yet.. please tell me any good news .. thx.. best regards..
  19. Hi guys. I have a little task that I can't complet it Let me explain. I have a sphere with 3 bones. Using bones and a slider I modify the sphere geometry, I can scale, translate or rotate the bones, It works like a morph. After deform the mesh I want to save it as new babylon file, without bones, but keep deform geometry, not original. In this scope I update positions, normals, compute normals, but all time the new babylon file is saved like original, and not deform. I have to update anything else? Or I have to save the skeleton too? ....If yes, than I have a problem, because I want to add an
  20. Hello everyone, Based on this comment, I realized that Phaser removed support for GeomSprites. However, I'm thinking about making a game in which I just need simple shapes rather than image/spritesheet assets. I thought about using the Graphics object, but realized that I cannot apply physics to the shapes I create using that (as far as I know). Then, I found information about game.debug.render to create circles and rectangles, but ran into the same problem. My question: Is there a way to create a sprite that is just a simple circle, rectangle, or any other basic shape AND has physics prop
  21. Hi, I need to generate a terrain mesh procedurally. I am currently doing it with lots of sprites stuck together in a line to generate the contour of the terrain. It works fairly well, but has a few quirks and seems to affect performance badly. What I was thinking of doing is generating the points in the preload function, then from that, draw a line to rendering the terrain, and then use the same points to generate the collision polygon. The issue I found is that the game.load.physics() function works with a url to a json object. Is there a way to pass it a json object that I created
  22. First off, thanks very much for the amazing tool, it must be a lot of work to maintain and it's amazing to be able to use it for free. As for the main issue, I'm getting an error when I try to add a geometric object to a group: phaser.js:14115 Uncaught TypeError: a.setStageReference is not a function Perhaps this is because groups are implemented in Pixi and geometry in Phaser? I'm doing this because I have a custom bitmapText, and text in general seems very unresponsive when I tap it. In particular, I think tapping in between adjacent characters won't fire an event. So I want
  23. Hello all, I have two simple questions. First of all, is it possible to collide a Phaser.Sprite with a Phaser.Rectangle? If not, is it possible to collide two Phaser.Rectangles? Thanks in advance...
  24. Hello! For my project I want to re-arrange an interesting feature: the rotation of the object by clicking in the right direction (and of its movement) on the principle of moving the spacecraft to point and rotation to the desired degree. How can I make such a function? Example attached.
×
×
  • Create New...