Search the Community

Showing results for tags 'viewport'.

More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


  • HTML5 Game Coding
    • News
    • Game Showcase
    • Coding and Game Design
  • Frameworks
    • Phaser
    • Pixi.js
    • Babylon.js
    • Panda.js
    • melonJS
    • Haxe JS
    • Kiwi.js
  • General
    • General Talk
  • Business
    • Collaborations (un-paid)
    • Jobs (Hiring and Freelance)
    • Services Offered

Found 17 results

  1. GUI "Viewport"

    I want to show a "viewport" of a target camera in a corner of the canvas that will work in VR. Surely there is a better way, but this PG shows my visual goal: Basically I have a TargetCamera and I take screenshots and set to source of GUI image. I'm just making sure there is not a well known better way before I get more creative. My goal is for this to work well in VR. I already had it working quite well with this code - but I am trying to move away from a second viewport as I'm assuming that won't work in VR: var viewport = new BABYLON.Viewport(0.79, 0.79, 0.2, 0.2); this.secondCamera.viewport = viewport; scene.activeCameras.push(secondCamera);
  2. The Load of 3D configurators in Realtime?

    Hi, I am 3D graphic designer and programmer. I create 3D configurators in Realtime like on the following website. The configurators was developed on WebGL-basis and have the problem that the only load if the configurators are visible in the viewport. How I can solve the problem? Thanks.
  3. Hi all, I created PlayGround how to display the ViewCube in the upper right hand corner. ViewCube provides visual feedback about the current viewpoint of the scene. Just for fun
  4. Hi There is bug when BABYLON.GUI buttons that has been created with custom viewport on camera: buttons can be clicked even if mouse is out of button playground:
  5. viewport

    hello actually i am using container renderer for background and above background placed images and images are dragging on mouse click but dragging is happening behind the game map i tried floating not working can anyone help please for drag movement
  6. HI, I'm trying to use screenspace2d as a button but when I add a viewport(minimap), the minimap becomes unclickable. Is there anyway I can change the z order or something similar to make the canvas clickable?
  7. Hi, I've successfully created a mini map. Now I'm trying to give it a custom opacity value to make it a littler transparent. I did not find any way to do this. Any help would be appreciated. Here is a good starting point for your kind help:
  8. Hi everyone: I need to implement a bezel compensation mechanism, but i dont know where to start. I have four screens acting like a big one. I don't have the option to use bezel compensation at driver level, so i need to figure it out how to make it at software. My first thought was use some kind of BABYLON.Viewport tranformation but the documentation of this class is very scarce. Any hint for accomplish this? Many thanks in advance.
  9. Hello, Because of performance and blurry text/image issues, I turned my fixed canvas resolution to a canvas with width/height dynamically equal to window.innerWidth/Height on resize. Admitting the same aspect ratio after resizing, how would you deal with the renderer to keep the same viewport ? Thanks.
  10. Hello guys, i'm totally new to Babylon and I was wondering if there's a way to check if an object is hitting the border of the screen and prevent it to get off the screen. This is what i wrote so far: I found these values manually, i hate to hard-code stuff inside my code but it was just for testing. if (box1.position.x > 6 ) { box1.position.x = 6; } if (box1.position.y > 4 ) { box1.position.y = 4; } if (box1.position.x < -6) { box1.position.x = -6; } if (box1.position.y < -4) { box1.position.y = -4; } Can you please me help to understand how can i retrieve the screen boundaries wrt the viewport?
  11. I wonder whether it is possible to translate browser viewport on Plane in 3D world. Like video texture on plane. And If this 3D plane can be interactive like browser is ??? Just ask how it is with this. Could be that possible to do? Could we have more browsers planes in 3d world which will be interactive? greetings
  12. I am curious if there is a better way to create a border around a viewport and a background around a viewport rather than creating additional viewports that have just border objects in it. I don't like this approach because i'm hiding objects in the far distance and cameras to render this stuff out. I have an example here using additional viewports to show what i am looking for. Suggestions of how to achieve this without the additional cameras/viewports/objects? I would like just two cameras in a perfect world Thanks!
  13. Hi I am trying to develop very basic 2D car game. In the game I want to show a small map on top right side of the screen which is actually same track but with a zoomed out scene so that user can see what is coming ahead of the car. I was able to accomplish this but now my problem is in the zoomed out map car is very small mesh. Is there any view where I can change size of a particular mesh(Car) and then create a view port or can I change size of mesh(Car) in just one viewport. I am attaching screenshot of scenario and code by which I have implemented my existing code var camera1 = new BABYLON.FreeCamera("camera1", new BABYLON.Vector3(0, 0, -8), scene);camera.viewport = new BABYLON.Viewport(0, 0, 1, 1);var camera2 = new BABYLON.FreeCamera("camera2", new BABYLON.Vector3(0, 0, -50), scene);camera2.viewport = new BABYLON.Viewport(0.8, 0.8, 0.2, 0.2);scene.activeCameras.push(camera1);scene.activeCameras.push(camera2);
  14. Minimap

    Hi guys, I missed you ) I have a new little problem, and I hope that you can help me. I have this example to support me: I want to create a minimap, but I don't know how to positionate it in front of scene map. The minimap is back of scene, in bottom-left. Thanks a lot.
  15. Hey there, I'm just getting started with Phaser, and am looking at GLSL shaders (also for the first time) to see how they can be applied to sprites for effects on characters, backgrounds, etc. I ran into behaviour today that's likely a function of how GLSL works, rather than Phaser itself, and probably not the ideal approach. In any case, I'm hoping that someone can confirm one way or the other. Currently, my game has: A TileMap background using two layers using different values for scrollFactorX/Y A Sprite for the player with a filter applied, which is being rendered correctly (although the sprite graphic itself has disappeared; more on this later) What's odd is that when navigating through the map and the filtered sprite reaches a viewport boundary, it remains "stuck" there rather than moving offscreen. Since the shader example I'm using has no knowledge of the game, and it looks like the sprite is simply unmasking the shader output, I'm wondering a few things: Am I right to assume that this doesn't work for good reasons? (If so, what are they? ) Assuming that I need shaders (versus a sprite sheet) for elements that may venture offscreen, should I be manually passing rect data to the filter that tracks the shapes I want filtered, separately from the sprite itself? I'm looking forward to any insight that folks can share, so let me know if I can provide more details. Thanks!
  16. Clear viewport.

    Hello community, I'm in need of help with something on my project. I need do draw a new scene in the same scene stuck in a while loop (while the option exit isn't pressed). By that I mean, that i would like to clear the all screen when this function is started, then, when exit is pressed, the "state machine" would come back to the main scene. I'm not beeing able to find any function to do this. Any suggestions ? Thanks in advance,
  17. Retina displays question

    I'm having a little trouble to understand this: I have a canvas, let's say 480x320, and I use a div container to resize it. CSS.canvas { width: 100%; height: 100%; }JSresize(); //Here using window.innerWidth and window.innerHeight I find the dimensions of the device and I apply those measurements to the div container so the game gets resized via CSS.Viewport<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no"> If I use this code on a retina device, will it display the game correctly stretched or double sized? Different pov, same question: will window.innerHeight return the device pixels or the CSS pixels? I can make the same question again using different words . I want to correct the images because I don't like how retina displays resizes my game. So I make my canvas double size 960x640 and use of course bigger sprites. Using the solution above, what should I do to fit my game, stick to the window.innerHeight value or use half of it because then it will be doubled by the display? I hope someone understood my question, if not, I can still ask it in several more different ways, I feel inspired today