Search the Community

Showing results for tags 'camera'.



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
    • Coding and Game Design
  • Frameworks
    • Phaser 3
    • Phaser 2
    • Pixi.js
    • Babylon.js
    • Panda 2
    • melonJS
    • Haxe JS
    • Kiwi.js
  • 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 365 results

  1. Hello, I am looking for camera examples that can run on mobile and use touch events to implement rotation, zoom operations. Any help will be appreciated.
  2. Hi, Not sure if it's a bug (rather an observation), but when I'm using BABYLON.DefaultRenderingPipeline(), it remove cameras from the given array. I think the function should make a copy of the given array, because if I give scene.cameras, the function remove cameras from the scene. Here's the PG: https://www.babylonjs-playground.com/#KZZ4TI#1 Thank you !!
  3. Playground demonstrating the issue: https://playground.babylonjs.com/#9JSLE2 Explanation: I'm trying to create a simple walk around scene and the built in collision system seems to work pretty darn well (Who needs a physics engine anyway?) but I've noticed that when I add any kind of slope the camera will slide down it -- in a real hurry too if gravity is set realistically! I noticed that this doesn't happen with the stairs in the Espilit demo, but looking at the scene file and demo.js I can't figure out how it's managing that. Is there a friction setting or something that I can set for objects like stairs and ramps?
  4. kurhlaa

    Incomplete camera's FadeIn effect

    Hi, It seems something is not finishing in the camera's fadeIn effect. If I use this code: var camera = scene.cameras.main; scene.time.delayedCall(5000, function() { camera.fadeOut(250); }, [], scene); camera.on('camerafadeoutcomplete', function() { camera.fadeIn(250); }); ... after the end camera stays a little dark, like not fully transparent. I've compared 2 screenshots. At the moment I'm forced to call camera.resetFX() to make colors brighter again. Can this be fixed?
  5. Simple: I need the Rotation Matrix from the default Arcrotate Camera. I read somewhere in the forum, i need to decompose the Camera Matrix, i can' t find it anymore. Subquestion: It is possible to grab the data via mouseevents ? Thanks' Playground: https://www.babylonjs-playground.com/#SQP9E0
  6. juanmajr93

    Universal camera

    Hi all, I am using new UniversalCamera to allow access of application web from pc or mobile devices. However It doesnt work so good. I have been testing example of @davrous and It is perfect!. Maybe I need to reprograme some tips of this camera. Now I can only turn camera in my tablet but i cant move. The version of BabylonJS that I am using is v 2.6 alpha Params of my camera: var camera = new BABYLON.UniversalCamera("universalCamera", new BABYLON.Vector3(600, 200, -500), scene); camera.setTarget(new BABYLON.Vector3(0,0,0)); camera.speed = 5; camera.checkCollisions = true; camera.ellipsoid = new BABYLON.Vector3(2, 3, 2); camera.attachControl(canvas); Thanks you very much!!!
  7. Hello everyone my first day with Babylon, so please indulge. I have the same problem as Emiya0306 but not with the gltf Exporter but with the Babylon Exporter (*.babylon) I have read the whole thread, but frankly, I didn't understand very much. The Arc Rotate camera goes through my object (with middle (Scroll)Mouse-Button). I have checked Collisions for the Object and the Camera. Did I miss something? Online: http://www.experimente.bplaced.net/collisions/collisions.html The Blend: http://pasteall.org/blend/index.php?id=49326 Babylon 3.1.0 Babylon-Exporter 5.62 Blender 2.79B Many thanks in advance Hans
  8. Jacko333100

    Camera Phaser 33

    Hey Guys, i created a camera in phaser 3 and everything works fine. thats my code. this.cameras.main.setSize(500,600); this.cameras.main.startFollow(this.kaefer); this.cameras.main.setBounds(0,0,this.GAME_WIDTH,this.GAME_HEIGHT); and now i want the camera to move with my player only and only if the player moves to the right or to the left( so no camera moving when my player jumps). and thats my code for moving the player. Can anyone help me please. i tried an if clause. but that didnt work fine. PLEASE HELP!!!! move(){ if (this.cursors.left.isDown){ this.setVelocityX(-160); this.anims.play(this.name + 'left', true); if(this.cursors.up.isDown && this.body.touching.down){ this.setVelocityY(-400); } } else if (this.cursors.right.isDown){ this.setVelocityX(160); this.anims.play(this.name + 'right', true); if(this.cursors.up.isDown && this.body.touching.down){ this.setVelocityY(-400); } } else if(this.cursors.up.isDown && this.body.touching.down){ this.setVelocityY(-400); }else{ this.setVelocityX(0); this.anims.play(this.name + 'turn'); } }
  9. MehdiZagouri

    How to camera go upstairs !

    Hi, I created stairs using CreateBox , i'm asking if it's the right way ! And i'm asking also , how can i make the camera go upstairs ! Thank you for your answers.
  10. Doug

    Hi Rich.  @rgk mentioned that you might be able to please add a "patron" badge to my forum profile?  Thanks very much!

  11. Hey Guys, first of all, I want to thank you for your great work in this forum, you really saved me a lot of time wanting to flip tables But now i found something, what is driving me nuts for already two weeks. So I am trying to develop a viewer for 3D objects which has, broken down on the most important things, two cameras which you can change. Those cameras happen to be the ArcRotateCam and the UniversalCam. What I want to happen is, that if the user clicks a button the camera changes (this already works fine), I also want both cameras to have a default position where they "start" (which they already have) and I want the camera to always be at the right position with the right angle (the default position/angle i set with initalizing them) when the user changes to the selected cam (this is where something odd is happening). So let's take this case: - User uses ArcRotate Cam, moves the camera and wants to change to Universal Cam. - User clicks the button and changes to Universal Cam -> Universal Cam is set to default position and default angle as its supposed to be. - User moves Universal Cam - User wants to change to ArcRotate Cam again and clicks button -> result: camera is not in default mode but there is some odd camera movement going on and camera is somewhere else. - If the user now moves the ArcRotate Cam again and changes to the Universal Cam, the camera moves away from the target, instead of being directly on it. I hope I described my problem properly and I really hope you got some answers. I broke the problem down in a Playground for you: http://playground.babylonjs.com/#P5PWBB There may be something missing cause I really broke the camera module down on the most important things. So if something is not clear, let me know! All the best! xeroxM
  12. Hello, I'm new here, so firstly I want to greet with all of you. Regarding my question, or maybe problem - some background here: I want to create minimal for My 2D space shooter. I check tutorials on labs.phaser where I saw example with creating MiniMap with second camera - it sounds good. So I created class for My MiniMap: import Phaser from 'phaser' export default class MiniMap extends Phaser.Cameras.Scene2D.Camera { constructor ({ scene, x = 10, y = 10, width = 192, height = 192, zoom = 0.1, scroll = { x: 960, y: 960 } }) { super(x, y, width, height) this.scene = scene this.zoom = zoom this.scroll = scroll } init () { this.scene.cameras.cameras.push(this) this.scene.cameras.addExisting(this) this.setZoom(this.zoom) this.setScroll(this.scroll.x, this.scroll.y) return this } } And I'm creating it in My GameScene in create() function: create () { this.bgImage = new BackgroundImage({ scene: this }).init() this.miniMap = new MiniMap({ scene: this }).init() this.miniMap.setBackgroundColor('black') this.player = new Spaceship({ scene: this, x: 0, y: 0 }).init() this.camera.startFollow(this.player) } About My sizing, BackgroundImage and Bounds are 1920 x 1920 px, so in MiniMap we had 192 x 192 and also zoom as 0.1 (1/10 of real game world). It should create Map with the whole world, but it is cut on left and top and have free space at right and bottom (attachment). How to fix it? Also, maybe you can give me some tips how to change Spaceship sprite on MiniMap (second camera) as for example dot? Thanks for advance! Best, DaaV
  13. I have a car moving based on some custom inputs. I want to put WebVRCamera in the driver's position, so they can look around using their headset. I have tried several ways to attach it to my car with no success: helper.webVRCamera.parent = content.headContainer seems to have no effect. helper.webVRCamera.position = content.boardFloor.position and helper.webVRCamera.rotation = content.boardFloor.rotation is messing up when the car rotates
  14. I'm trying to zoom camera (change its scale) while focused on a player on a tilemap. const speed = 0.01; if (this.cursors.up.isDown) { this.game.camera.scale.add(speed, speed); } else if (this.cursors.down.isDown) { this.game.camera.scale.add(-speed, -speed); } This is how I create the map: this.map16 = this.game.add.tilemap("tilemap16"); this.map16.addTilesetImage("xrpg_tileset", "tileset16"); this.wallsLayer = this.map16.createLayer('Walls'); Both player object and the map layers are placed in the World. But it seems that tilemap layer's position is affected by camera's zoom which looks wrong: https://gph.is/2HuEeDk To check if something is wrong with the scene I replaced the map with an image and zoom worked correctly: https://gph.is/2KitDZL The behaivor is identical in 2.6.2 and 2.10.3.
  15. Here is my simple playground demo. Just like the title described, Why this ArcRotate camera can go through the mesh? Is this the gltf file problem?
  16. Is there a built-in way to apply a smooth animation on the active camera, given a start position, orientation, a final position, a final orientation and time frames?
  17. Hi, 1) Is there a way to react on a position/rotation change of the camera? 2) How do i get the position and or the rotation of the camera? What i wanna do: I wanna change the position and/or rotation of another mesh in the scene every time the camera is changed. The rotation of the other mesh is depended of the camera rotation. Thx in advance
  18. hi i am new to babylonjs,this is the first post i made. my problem is that i make a camera,no matter the ArcRotate Camera ,FollowCamera or ArcFollowCamera the target mesh just fixed the position in the center of the screen that is very good for lots of game however i just want to make my game the target mesh a little offset at the center of screen like :at the middle bottom left screen. or any other position i want is there a simply way or a api to make it ? thanks
  19. Hi all, I am planing to build online black jack game. I wanted to create a perspective view environment for this game. I wanted to add animations like flipping cards, squeezing cads, dealing etc. I am looking for a game engine for this. I have not used Pixi JS before. But I do have experience with Cocos Creator. May I know whether something like this be done with Pixi JS? If it is possible can someone point to area I should be check? Greatly appreciate any help you can provide.
  20. Looking at the camera bouncing behaviour documentation PG example https://www.babylonjs-playground.com/#6FBD14 I can't notice any bouncing effect at all. Is it just really subtle or isn't it working?
  21. Hi! I am using Phaser CE, and here is some code: var level1 = { map:{ size:48, w:36, h:6, layout:[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2, 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2, 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2] }, create: function(){ game.scale.scaleMode = Phaser.ScaleManager.SHOW_ALL; game.physics.startSystem(Phaser.Physics.ARCADE); game.stage.backgroundColor = "#0ff"; game.renderer.renderSession.roundPixels = true; game.world.resize(this.map.size*this.map.w,this.map.size*this.map.h); this.background = game.add.tileSprite(0,0,game.world.width,game.world.height,'bg'); this.background.scale.setTo(3,3); this.ost = game.add.audio('music'); this.ost.loop = true; this.ost.play(); this.tiles = []; var j = 0; for(var i = 0;i<this.map.layout.length;i++){ if(this.map.layout[i]!=0){ switch(this.map.layout[i]){ case 1: this.tiles[j] = game.add.sprite((i%this.map.w)*this.map.size,Math.floor(i/this.map.h)*this.map.size,'tile2'); case 2: this.tiles[j] = game.add.sprite((i%this.map.w)*this.map.size,Math.floor(i/this.map.h)*this.map.size,'tile'); } this.tiles[j].width = this.map.size; this.tiles[j].height = this.map.size; game.physics.arcade.enable(this.tiles[j]); this.tiles[j].body.immovable = true; j++; } } player.create(); game.camera.follow(player.sprite,0.4,0.4); }, update: function(){ for(var i = 0; i < this.tiles.length; i++){ game.physics.arcade.collide(player.sprite,this.tiles[i]); } this.orientationChange(); player.render(); this.background.tilePosition.y += 0.25; }, orientationChange: function(){ game.scale.scaleMode = Phaser.ScaleManager.SHOW_ALL; } } That was my player sprite colliding with a 1-D tilemap array. My problem is this -- When the player jumps, or isn't near the lower half, it looks normal(first screenshot. When it collides with the ground tiles (labeled 1 or 2) the camera acts as if I've touched the bottom of the screen, instead of showing the sprite on the tile, centered...(second screenshot) Please help! I am using Phaser from just a week, and this is a peculiar issue. There is a sample game at smvaidya.itch.io/DuskMite That map with tiles all over worked just fine but the one tiles which were set as floor (3 rows!) don't show up. They are under the screen. Why?
  22. devAxeon

    VR camera height

    Hi, How about an option in vrHelper to force the height of the camera, even if isInVRMode is true ? I'm testing my scene seated, but I want to be in a stanted view inside my VR. So it will be nice if we have a forceDefaultHeight option in webVROptions, to always be standing Thank you !!
  23. Hello guys, I use the UniversalCamera in my project. On my mobile device it works really well and does what I want it to do, except for the left and right rotation. When I wipe up and down, the camera moves much faster than left and right. I have already tried the camera. angularSensibility, but it has no visible effect. for example, if I use the Gyro camera and press on the screen, I can control the camera very well and would like to have such a behaviour with the UniversalCamera. Did I miss something or is there a value I need to adjust? I would like to double the speed of mobile devices (the device differentiation is already taken over by my framework). Then it has a smooth user behavior. I look forward to your answers. :-)
  24. Gerente

    Camera 2d

    Hi, im working on the camera of my game, its a 2d game and I need to center the camera to the character, enemies, etc.. to different objects in or out of the screen. Anyone could advice me about this, any good practice, technique, mistakes, etc.. I'm just moving the camera toward the object and stopping it when the distance is lower than the camera speed but I have some artifact on the way when I play it on mobile vs pc. Seems that devicePixelRatio have something to do with this.
  25. I do not find the error in this code anyone help me please. I'm doing a topdown game but I can not get the camera to follow the sprite player.... Sorry if I'm doing something wrong! this.Camera.follow (player, Phaser.Camera.FOLLOW_TOPDOWN); this does not work ! do not open anything; When I remove it everything works normal var config = { type: Phaser.CANVAS, width: 1920, height: 1080, physics: { default: 'arcade', acarde:{ //gravity:{ } debug: false } }, scene: { preload: preload, create: create, update: update } }; var game = new Phaser.Game(config); function preload () { this.load.image('ground', 'images/ground-smart.png'); //pedras this.load.image('stone1', 'images/stone-1.png'); this.load.image('stone5', 'images/stone-5.png'); //flores this.load.image('flor1', 'images/flor1.png'); this.load.image('flor2', 'images/flor2.png'); this.load.image('flor3', 'images/flor3.png'); //player this.load.spritesheet('player1', 'images/p-anim.png', { frameWidth: 128, frameHeight: 90 }); } function create () { this.add.image(960, 540, 'ground'); this.add.image(64, 430, 'stone1'); this.add.image(650, 80, 'stone5'); flores = this.physics.add.staticGroup(); flores.create(400, 350, 'flor1'); flores.create(220, 90, 'flor3'); player = this.physics.add.sprite(400, 300, 'player1'); this.Camera.follow(player, Phaser.Camera.FOLLOW_TOPDOWN); this.anims.create({ key: 'left', frames: this.anims.generateFrameNumbers('player1', { start: 1, end: 7 }), frameRate: 6, repeat: -1 }); this.anims.create({ key: 'turn', frames: [ { key: 'player1', frame: 0 } ], frameRate: 20 }); this.anims.create({ key: 'right', frames: this.anims.generateFrameNumbers('player1', { start: 1, end: 7 }), frameRate: 10, repeat: -1 }); cursors = this.input.keyboard.createCursorKeys(); this.physics.add.collider (player, flores); } function update () { if (cursors.up.isDown) { player.setVelocityY(-160); player.anims.play('left', true); } else if (cursors.down.isDown) { player.setVelocityY(160); player.anims.play('right', true); } else { player.setVelocityX(0); player.anims.play('turn'); } if (cursors.up.isDown && player.body.touching.down) { player.setVelocityY(-330); } }