Jump to content

Search the Community

Showing results for tags 'heightfield'.

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

  1. I need some simple pointers on how to turn an imported model into a Cannon.js heightfield. I would prefer this over actual heightmaps, as I feel that I'm more in control of the design of the ground. I made a simple PG example so I can test it along the way. Just a very basic model made out of a 20x20 plane. How would you pull the positions(Especially Y) on the individual vertices, so they can be used to create the heightfield shape and added to a Cannon.js body? This is the relevant code from the heightfield demo: var matrix = []; var sizeX = 15, sizeY = 15; for (var i = 0; i < sizeX; i++) { matrix.push([]); for (var j = 0; j < sizeY; j++) { var height = Math.cos(i/sizeX * Math.PI * 2)*Math.cos(j/sizeY * Math.PI * 2) + 2; if(i===0 || i === sizeX-1 || j===0 || j === sizeY-1) height = 3; matrix[i].push(height); } } https://github.com/schteppe/cannon.js/blob/master/demos/heightfield.html
  2. How can I get my mesh moving around on a height field when using Oimo Plugin in Babylon js? This is "working": Render.prototype.createScene = function(){ this.ground = BABYLON.Mesh.CreateGroundFromHeightMap("ground", "textures/heightMap.png", 50, 50, 100, 0, 2, this.scene, false, onGroundCreated);}function onGroundCreated(ground){ ground.setPhysicsState(BABYLON.PhysicsEngine.BoxImpostor, {friction:0, mass: 0, move : false });}The problem is, as the Imposter is a Box, my Mesh moves just on top of the height field. In this tutorial: https://blogs.msdn.microsoft.com/davrous/2014/11/18/understanding-collisions-physics-by-building-a-cool-webgl-babylon-js-demo-with-oimo-js/ It states four different possibilitys for colliders. Box, Sphere, Capsule and Mesh. Is Capsule and Mesh also available in the Babylon OimoJSPlugin? Because I guess thats what I would need to move around the height field i guess. Or maybe there are other valid options for that problem.
×
×
  • Create New...