# Tagged Questions

Game worlds are viewed from a camera, which is the viewpoint from which the game world is observed from.

734 views

### Tiled map seen from an angle

I have working code to display a tiled map. It's composed of a OrthogonalTiledMapRenderer and an OrthoGraphicCamera : camera.setToOrtho(false, WORLD_WINDOW_SIZE.x, WORLD_WINDOW_SIZE.y); ...
543 views

### Accumulating rotations for camera

It seems there are three ways to store a camera's rotation: in angles, view matrix or quaternion. I was using euler angles since when I used a matrix it had a tendency to accumulate rounding errors ...
411 views

### How do I create a camera for a strategy game?

How do I make a camera for a strategy game? Think something in the style of Warcraft 3, so you can lower the camera angel and view the world in a somewhat 3D format. Do I need to have some coordinate ...
292 views

### Optimising out tiles outside of viewport

I am playing around with the HTML5 canvas and have begun implementing a tile engine. However, it's currently very inefficient: I have a 100x100 2D array and my code loops through the whole thing ...
2k views

### Implementing a camera on HTML5 canvas?

I am trying to work out the best way of implementing a camera in my simple 2d game. The way it is structured at the moment is my game objects all have draw functions, which are passed a canvas ...
277 views

### Camera Math for Directions

I have a Camera object that has the variables: class Camera : Object { public: float positionX, positionY, positionZ; float directionX, directionY, directionZ; int speed; }...
577 views

### Calculate new coords of camera after a 90 degree rotation in an isometric 2D projection

I made a 2D isometric renderer. It works fine but now I want to show my scene from 4 different points of view (NE NW SE SW) but, on a 90° rotation, my camera cannot keep the center of my scene on ...
522 views

### Unity3D Camera constantly moving

I'm trying to make my own first person camera controls in unity that use both thumbsticks on a joypad. I have this working fine. However, when I move the right thumb stick (the one uses to look left / ...
1k views

### Zoom In/Out Camera To Show Whole World

I am developing side scrolling game using AndEngine, and looking for additional camera control. I would like to view the whole level and then zoom/pan the camera to the left corner of the scene. ...
378 views

### Camera - View matrix in Android + openGLES 2

I am trying to use the touch screen on the tablet to control my camera movements and generate the view matrix accordingly. I get the x and y coordinates of the screen and after doing some sanity ...
1k views

### How do I create multiple 2D spotlights?

I'm looking to create a 2D "spotlight" effect that allows a spotlight on multiple entities. I.e., as if several sprites were holding torches. For a single entity (one spotlight), I use a technique ...
649 views

### Camera movement using WASD on x/z plane only

I've been wearing my enter key down on google searches - I have a camera script based on the MouseOrbit.js asset. That's all working fine, but in addition to the basic orbiting and the zooming that I'...
114 views

### Dealing with field of view when zooming into a terrain from a height

I'm creating a tech demo featuring a small planet. The problem I'm having is that the planet doesn't really feel like the right "scale" when the camera in down on the surface, I think it could be the ...
718 views

I am developing a prototype for a game in Flixel in which a character floats upward continually to traverse the level. I would like to have a "tall" layout for levels and set the FlxG.camera to follow ...
74 views

### resizing directx control so that more of my object's environment is visible [closed]

I'm very new in 3D. I have a DirectX control which I want to be able to resize. A 3D object is shown in the control. On resize, I would like that object to stay the same size, only more of its ...
995 views

### XNA - moving the 3rd person camera

I'm having following problem: Can't set my camera to follow object from behind and rotate when I use left/right arrow. I've tried different tutorial and examples but it still doesn't work for me. Don'...
7k views

### Cast ray to select block in voxel game

I am developing a game with a Minecraft-like terrain made out of blocks. Since basic rendering and chunk loading is done now, I want to implement block selecting. Therefore I need to find out what ...
192 views

### Difference between rotation methods?

My question is in about rotate methods in android.graphics.Camera. In Docs, I saw these comments: public void rotateX (float deg) Since: API Level 1 Applies a rotation transform around the X ...
1k views

### FPS games: don't they have unrealistic one-eyed view? What are the causes?

I have played many fps games, and noticed that the camera perspective is similar to the 'one eyed view' of the surroundings. It does not feel like bilinear. :/ Is it because of the single flat view ...
1k views

### How do I make camera follow the player within some bounds?

I am creating a simple ambient/explorer platformer. Because I want the player to only be able to see a new area once they have reached it, I decided to split up the world in rooms. To not make things ...
1k views

### XNA - move camera over tilemap

I am trying to build a game based on Advance Wars in XNA. I am so far where the tiles are placed on the screen, except here starts my problem. During the game, I ofcourse want to move the camera ...
308 views

### OpenGL glMatrixMode rotation

I'm stuck on trying to figure out how to rotate the viewport(or camera). So far I've figured out I need to use the function glRotatef and glMatrixMode(GL_MODELVIEW). But I have no idea how to apply ...
8k views

### Implementing a camera / viewport to a 2D game

What is the most practical way to implement camera/viewport to a 2D-game? I've read, that I should store the object world position instead of position relative to the screen? Current situation: I ...
570 views

### OpenGL ModelView matrix

Hello I am trying to understand matrix operations behind OpenGL and I have some questions. 1- When we first create a simple window using glut and opengl, we use such a command below to draw a simple ...
705 views

### Swaying Camera when Walking

You can see the effect in many games. The camera sways or wiggles a bit while walking to make the movement feel more realistic. I have implemented a camera in my game. (Who'd have thunk it?) So is ...
1k views

### Blender Object Appearing Gray when all Lights are Off

I have an issue with Blender where, when I turn my only light off (a sun lamp) and render the image my object appears gray rather than black (and thus, not appear to the camera). I can't figure out ...
1k views

### libGDX using Stage and Actor produces different camera angles on desktop and Android Phone

libGDX using Stage and Actor produces different camera angles on desktop and Android Phone. Here are pictures demonstrating the problem: http://brandonyuh.minus.com/mFpdTSgN17VUq On the desktop ...
148 views

### Why does CameraZ=0 result in no render?

I am trying to draw simple model, but I am experiencing strange error. When I use this View matrix: Matrix.CreateLookAt(new Vector3(0, 200, 1), new Vector3(0, 0, 0), Vector3.Up); my model is drawn ...
1k views

### Making a Camera look at a target Vector

I have a camera that works as long as its stationary. Now I'm trying to create a child class of that camera class that will look at its target. The new addition to the class is a method called ...
305 views

### How to create GoogleMaps-like camera for simple 2D strategy game? [closed]

I am just starting in game development (with web programming background). I want to know how to create 2D game with camera that can zoom in/out and can be moved like map in Google Maps. Could you help ...
95 views

### XNA 3D coordinates seem off

I'm going through a book, and the example it gave me seems like is should work, but when I try and implement it, it falls short. My Camera class takes three vectors in to generate View and Projection ...
419 views

### 3D Camera manager tool – is there any?

Are there some libraries or example codes, of a camera manager – a tool, that would move camera using some smooth lines (bsplines or similar)? So basically I request an animation to move to a new eye/...
7k views

### 2D camera perspective projection from 3D coordinates — HOW?

I am developing a camera for a 2D game with a top-down view that has depth. It's almost a 3D camera. Basically, every object has a Z even though it is in 2D, and similarly to parallax layers their ...
589 views

### Orthographic unit translation mismatch on grid (e.g. 64 pixels translates incorrectly)

I am looking for some insight into a small problem with unit translations on a grid. Update and Solved I solved my own issue. See below for details. Everything in this part of the post turned out to ...
443 views

### Drawing two orthogonal strings in 3d space in Android Canvas?

I want to draw two strings in canvas. The first string must be rotated around the Y axis, for example 45 degrees. The second string must start at the end of the first string and also it must be ...
13k views

### How to add a scrolling camera to a 2D Java game?

I am attempting to create a game where the camera follows the player, always making sure the player is in the center of the screen. How would I go about this? This game is a 2D Java game, made with no ...
478 views

### C# 2D Camera Max Zoom

I have a simple ship sprite moving around the screen along with a 2D Camera. I have zooming in and out working, however when I zoom out it goes past the world bounds and has the cornflower blue ...
289 views

### Stage3D: Camera pans the whole screen

I am trying to create a 2D Stage3D game where you can move the camera around the level in an RTS style. I thought about using Orthographic Matrix3D functions for this but when I try to scroll the ...
256 views

### Camera lookAt target changes when rotating parent node

have the following issue.I have a camera with lookAt method which works fine.I have a parent node to which I parent the camera.If I rotate the parent node while keeping the camera lookAt the target , ...
299 views

### How do I convert my matrix from OpenGL to Marmalade?

I am using a third party rendering API, Marmalade, on top of OpenGL code and I cannot get my matrices correct. One of the API's authors states this: We're right handed by default, and we treat y ...
6k views

### How to rotate camera centered around the camera's position?

Currently I am using gluLook at like so: gluLookAt(position.x, position.y, position.z, viewPoint.x, viewPoint.y, viewPoint.z, upVector.x, upVector.y, upVector.z); with the above,...
147 views

### Keep 3d model facing the camera at all angles [duplicate]

I'm trying to keep a 3d plane facing the camera at all angles but while i have some success with this: Vector3 gunToCam = cam.cameraPosition - getWorld.Translation; Vector3 beamRight = Vector3.Cross(...
10k views

### How to add isometric (rts-alike) perspective and scolling in unity?

I want to develop some RTS/simulation game. Therefore I need a camera perspective like one knows it from Anno 1602 - 1404, as well as the camera scrolling. I think this is called isometric perspective ...
704 views

### Moving camera, or camera with discrete “screens”?

I'm making a game with a friend, but having trouble deciding on a camera style. The basic idea for the game, is having a randomly generated 2-dimensional world, with settlements in it. These ...
35k views

### Why do we move the world instead of the camera?

I heard that in an OpenGL game what we do to let the player move is not to move the camera but to move the whole world around. For example here is an extract of this tutorial: OpenGL View matrix ...
814 views

### Panning a 3d viewport in 2d direction with rotated camera

I am using below code to pan the viewport (action script 3 code using flare3d framework) _mainCamera.x-= Input3D.mouseXSpeed; _mainCamera.z+= Input3D.mouseYSpeed; Where as Input3D.mouse[X|Y]Speed ...
203 views

### Camera not staying behind model while moving in circle

I have a camera behind a model (3rd Person) and I'm having problems KEEPING it behind the model. When I first start my game, you see the back of the model. If the model moves forward, backward or ...
311 views

### Limit the amount a camera can pitch

I'm having problems trying to limit the range my camera can pitch. Currently my camera can pitch around a model without restriction, but having a hard time trying to find the value of the degree/...