Search the Community

Showing results for tags 'babylon viewworldprojection 3dto2d'.



More search options

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

Found 1 result

  1. hi. I want to check the camera can see the point. and I caculate the worldviewProject like which is the Vertex shader has. the code: // worldViewProjectionMatrix = world * view * projection // worldViewProjectionMatrix * vector var viewport = camera.viewport.toGlobal(engine); var cw = viewport.width; var ch = viewport.height; var cx = viewport.x; var cy = viewport.y; var viewportMatrix = BABYLON.Vector3._viewportMatrixCache ? BABYLON.Vector3._viewportMatrixCache : (BABYLON.Vector3._viewportMatrixCache = new BABYLON.Matrix()); BABYLON.Matrix.FromValuesToRef(cw / 2.0, 0, 0, 0, 0, -ch / 2.0, 0, 0, 0, 0, 1, 0, cx + cw / 2.0, ch / 2.0 + cy, 0, 1, viewportMatrix); var matrix = BABYLON.Vector3._matrixCache ? BABYLON.Vector3._matrixCache : (BABYLON.Vector3._matrixCache = new BABYLON.Matrix()); BABYLON.Matrix.Identity().multiplyToRef( viewportMatrix , matrix); matrix.multiplyToRef(camera.getProjectionMatrix(), matrix); var p2 = BABYLON.Vector3.TransformCoordinates(vector, matrix) //BABYLON.Vector3.Project(vector, world, transform, viewport) var p = BABYLON.Vector3.Project(vector, BABYLON.Matrix.Identity(), scene.getTransformMatrix(), //scene.getTransformMatrix(), camera.viewport.toGlobal(engine)); console.log(p); console.log(p2); // p and p2 xy not like help.