Jump to content

Search the Community

Showing results for tags 'orthographic'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


  • 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


Last Updated

  • Start


Filter by number of...


  • Start



Website URL





Found 6 results

  1. I was playing around with SSAO, but could not get it to work with an orthographic camera. Is this not possible? Any workarounds? Any feedback appreciated
  2. Hi, I am developing a game with babylon.js, and I use an isometric view (so z coordinate, is actually pointing top left of the screen, and x bottom left) : var zoom = 2; var cameraPosition = new BABYLON.Vector3(5*zoom, 4.1*zoom, 5*zoom); var scene = new BABYLON.Scene(engine); var camera = new BABYLON.TargetCamera("camera1", cameraPosition, scene); camera.mode = BABYLON.Camera.ORTHOGRAPHIC_CAMERA; camera.orthoTop = 2.5 * zoom; camera.orthoBottom = -2.5 * zoom; camera.orthoLeft = -5 * zoom; camera.orthoRight = 5 * zoom; Therefore, when the player wants to go up (velocity.top), the controlled mesh should increment both z, and x, which results in the following equations : if (player.velocity.top !== 0 && player.velocity.left !== 0) var d = 0.7071; // Cos(45°) else var d = 1; player.position.z += Math.sign(player.velocity.top - player.velocity.left) * d * t; player.position.x += Math.sign(player.velocity.top + player.velocity.left) * d * t; All this seems to be working fine. Now, I would like the orthographic camera to follow the player when he is moving. I can't make the camera target the player, as it breaks the isometric view : the camera doesn't move to follow the player, it rotates, and as the angle of the camera changes, the isometric view breaks. Instead, I think I need to move the bounding box of the orthographic camera to be centered on the player position. But because the camera is orthographic, the bounding box doesn't seem to be related to the same coordinates as the player : the same way position.z is an arbitrary combination of velocity.top and veloctiy.left, orthoTop should be the inverse combination of position.z and position.x. So instead, my idea was to increment the bounding box by the same amount the player moves (as the velocity is in the same direction than the bounding box). By tweaking the values, I came up with this approximate solution, which I have a hard time to understand. if (player.velocity.top !== 0 && player.velocity.left !== 0) var d = 0.35; // Cos(45°)³ else var d = 1; camera.orthoTop -= Math.sign(player.velocity.top) * d * t * .7; camera.orthoBottom -= Math.sign(player.velocity.top) * d * t * .7; camera.orthoLeft -= Math.sign(player.velocity.left) * d * t * 1.4; camera.orthoRight -= Math.sign(player.velocity.left) * d * t * 1.4; It is approximate, because it only minimizes the error of movement between the camera and the mesh. But if the player goes one direction long enough, it will eventually go out of the screen. I am pretty sure there is an explanation for all this, but can't find it. What is the correct way to make an orthographic camera follow a target in an Isometric view ? Thanks,
  3. At least in the case of an ArcRotateCamera, the scene objects are not visible if the initial position of the camera is Vector3(0, 10, 0), or directly above. If its Z position is set even a fraction off of zero, there is no problem. http://www.babylonjs-playground.com/#JLPAE#138
  4. Hi, I already replied to @faljses post in bugs section (link below) but I'm not sure this really is a bug so I'll try and ask here too if anyone knows a way to do this. So, I'm trying to use picking with an orthographic camera. My picking code works as long as I use a camera in mode=0 but in orthographic mode it never hits anything. Here is faljses playground example that shows that as soon as you change the camera mode to 1, the picking stops working. http://www.babylonjs-playground.com/#XUDHE I already searched the source for some hours by now to see if I can spot a bug but didn't find one. I suspect that what ever goes wrong (bug or me using the framework wrong) has to do with the cameras projection matrix. In my own code I use Scene.pick to get my picking information but I suspect, that the problem I experience is the same as the one we see in the Playground, thus I'd like to focus on the Playground first for convenience. I appreciate any hints I can get, as I need to get this working, so if you have an idea what might go wrong here please tell me. faljses post in Bugs section:
  5. Hi, I noticed picking doesnt work correctly when using an orthographic camera. I could reproduce the problem modifying your samples on playground: http://www.babylonjs-playground.com/#XUDHE Result is always false: {hit: false, distance: 0, pickedPoint: null, pickedMesh: null, bu: 0…} Is this supposed to work, or do i need to use a different method for ortho projection? faljse
  6. Hello, I read probably most of posts about orthographic camera here but I can't find the answer how to set up orthographic camera to achieve an isometric view like here: http://www3.ul.ie/~rynnet/keanea/isometri.htm . How exactly set this up in code? var camera = new BABYLON.FreeCamera(camera_name, new BABYLON.Vector3(5, 10, 15), scene);Can someone please help? How to achieve 120' angle between axis?
  • Create New...