Jump to content

Search the Community

Showing results for tags 'transform matrix'.

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

  1. Hello guys, im trying to join two meshes (spheres) with a cylinder.( maybe basic but i'm having hard times as a beginner). The problem is that the default cylinder constructor leaves you with just the ability to only set the size , diameter of both top and bottom, and tessellation · Mesh.CreateCylinder(name, height, diameterTop, diameterBottom, tessellation, scene, updatable) ​when i need to do something like · New Cylinder(vectorStart, vectorEnd, scene) ​ i've tried something like: Cylinder = function(vstart,vend, scene){ var HALF_PI = Math.PI/2 ; var distance = BABYLON.Vector3.Distance(vstart, vend); var position = vend.clone().add(vstart).divide(new BABYLON.Vector3(2,2,2)); var material = new BABYLON.StandardMaterial("kosh", scene); var cylinder = BABYLON.Mesh.CreateCylinder("cylinder", distance, 1, 1, 36, scene, true); var orientation = new BABYLON.Matrix(); var offsetRotation = new BABYLON.Matrix(); orientation = BABYLON.Matrix.LookAtLH(vstart, vend, new BABYLON.Vector3(0,1,0)); offsetRotation =BABYLON.Matrix.RotationX(HALF_PI); orientation.multiply(offsetRotation); cylinder.bakeTransformIntoVertices(orientation);; cylinder.position = position;; } but it doesn't seem to work . maybe i'm having a really bad approach of the problem but actually i really don't know what to do . Can someone have any idea for me ? help will be so appreciated thanks in advance ! .
×
×
  • Create New...