Jump to content

Search the Community

Showing results for tags 'surface'.

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

  1. I was inspired by this topic to produce a bezier surface. The surface is not a mesh but a logical object that contains the data from which you can build the mesh using a ribbon. I restricted myself to a bicubic surface. Over the next weeks I will add some other methods and who know perhaps try to write a typescript version and PR it. This PG animates the surface by changing the control points, https://www.babylonjs-playground.com/#KT9EE7#1 In this PG you can move the control points (purple spheres) in the direction of the chosen axis. Click on a control to move the axes to that control, click on a cone to set the axis along which you move the control ( done by giving mesh behaviours a go) then drag the control https://www.babylonjs-playground.com/#KT9EE7#2 Work still in progress. have fun.
  2. Hi there ! I'm trying to add a subdivision surface on a loaded json file with Three.js and SubdivisionModifier.js or BufferSubdivisionModifier.js without any result. I searched and found various code and topic but none of them worked. That's why I'm looking for help here. my code with the BufferSubdivisionModifier.js : function initMesh() { var loader = new THREE.JSONLoader(); loader.load('js/cube.json', function(cubeGeometry, materials) { cubegeometryClone = cubeGeometry.clone(); cubegeometryClone.mergeVertices(); cubegeometryClone.computeFaceNormals(); cubegeometryClone.computeVertexNormals(); var modifier = new THREE.BufferSubdivisionModifier(1); smoothCube = modifier.modify( cubegeometryClone ); mesh = new THREE.Mesh(smoothCube, new THREE.MultiMaterial(materials)); // of course cube appears if you replace smoothCube by cubeGeometry mesh.scale.x = mesh.scale.y = mesh.scale.z = 0.95; mesh.translation = cubegeometryClone.center(cubeGeometry); scene.add(mesh); }); } no errors in console my code with the SubdivisionModifier.js which is the example I found mostly : function initMesh() { var loader = new THREE.JSONLoader(); loader.load('js/cube.json', function(cubeGeometry, materials) { smooth = cubeGeometry.clone(); smooth.mergeVertices(); smooth.computeFaceNormals(); smooth.computeVertexNormals(); var modifier = new THREE.SubdivisionModifier(1); modifier.modify(smooth); // if I comment this line, cube show but, of course, with no surface smoothing mesh = new THREE.Mesh(smooth, new THREE.MultiMaterial(materials)); mesh.scale.x = mesh.scale.y = mesh.scale.z = 0.95; mesh.translation = cubeGeometry.center(cubeGeometry); scene.add(mesh); }); } console show : TypeError: undefined is not an object (evaluating 'v.x') any help will be apreciated, I'm getting mad after 2 days of tries thanks
  3. Frist- Hi evryone, i'm newbie on Babylon Js. Second - i'm lookin for similar args , with no goal. - - sorry if alredy exist one Problem I'm looking for method to select all surface facets (basically I select the entire surface) My idea is: R1: "Facets with two vertices equal are contiguous" ( evaluate a set of coordinates) R2: "Valuate the same oriented 'Normal' facets " Evaluate true of R1 && R2, made well done job? Thanks 4 help
  4. 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; var i1 = 0; var i2 = 0; var i3 = 0; var nbFaces = indices.length / 3; for (var i = 0; i < nbFaces; i++) { i1 = indices[i * 3]; i2 = indices[i * 3 + 1]; i3 = indices[i * 3 + 2]; v1x = positions[i1 * 3] - positions[i2 * 3]; v1y = positions[i1 * 3 + 1] - positions[i2 * 3 + 1]; v1z = positions[i1 * 3 + 2] - positions[i2 * 3 + 2]; v2x = positions[i3 * 3] - positions[i2 * 3]; v2y = positions[i3 * 3 + 1] - positions[i2 * 3 + 1]; v2z = positions[i3 * 3 + 2] - positions[i2 * 3 + 2]; crossx = v1y * v2z - v1z * v2y; crossy = v1z * v2x - v1x * v2z; crossz = v1x * v2y - v1y * v2x; ar = ar + Math.sqrt(crossx * crossx + crossy * crossy + crossz * crossz); } return ar * 0.5; }; As it doesn't allocate any object, nor calls external functions, it should be fast, GC friendly and it might be called within the render loop. Just let me know if you want it to be integrated in BJS as a method of the class Mesh or AbstractMesh. [EDIT] For experts, note that this computation could be shared and done in one line only within the method ComputeNormals() of the class VertexData just after this line : https://github.com/BabylonJS/Babylon.js/blob/master/src/Mesh/babylon.mesh.vertexData.ts#L2007 with something like : area += length * 0.5;
  5. Hello, I am a stuck with a problem on putting the game in fullscreen on the Windows Surface pro 4 (I think the problem is on previous Surface too). Actually, I have a button that calls startFullScreen. Touching it on the Surface tablet does not go to fullscreen mode. But when I click that button with the stylus or the mouse pad of the Surface tablet keyboard, it works. When I the game on my Android phone, touching the button fullscreen works. I suspect the user agent to tell bad info, but I'm not sure. On both Surface and Desktop Chrome browsers, I have the same info doing navigator.userAgent like the tablet is a desktop... Is anyone got the same problem ? If yes, how can we solve this issue? Thanks for your help !
×
×
  • Create New...