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

learn more… | top users | synonyms

5
votes
2answers
345 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 ...
4
votes
2answers
3k views

Calculating up-vector to avoid gimbal lock using euler angles

I wish to orbit a camera around a sphere, yet the problem is that when the camera rotates so that it is at the north pole (and pointing down) or the south pole (and pointing up) of the sphere the ...
4
votes
1answer
3k views

Mouse location is off due to camera

I'm building a top down shooter but I have a little issue with my camera and mouse. When I add the camera that I use to my game (see here) my mouse pointer seems to be in the wrong location. When I ...
4
votes
2answers
982 views

Perfect FPS camera angle

I am making a multiplayer FPS and I am in search of some helpful tips on the perfect FPS camera angle. Because it is a multiplayer, I am making a full body model holding the gun, I find, however, that ...
4
votes
1answer
138 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 ...
4
votes
1answer
205 views

OpenGL rendering looks squeezed

I am rendering bunch of cubes of unit size, but for some reason they look like they are squeezed a bit in the screen-space y axis. Why is this? My projection matrix: Projection = ...
4
votes
1answer
159 views

Is there a way to write a camera class without matrix-transformation?

I have a problem with a camera class I got from the internet. It does a transformation like this: public Matrix get_transformation(GraphicsDevice graphicsDevice) { _transform = ...
4
votes
2answers
2k views

Multiple viewpoints in Unity3D?

I'm working on a 3D game in Unity. The primary view is a top-down view, but I am also looking to do target profiles that are true animated versions that reflect the actions of the target. The ...
4
votes
1answer
733 views

How can I achieve a zoom-like camera effect?

I have a top down 3D camera: view = Matrix.CreateLookAt(new Vector3(0,0,20), Vector3.Zero, Vector3.Up); Now I want to achieve the effect like when I zoom in the scene and only show a section at the ...
4
votes
1answer
2k views

How can I track a falling ball with a camera?

I have been trying to get my camera to follow a falling ball but with no success. here is the code float cameraY = (FrustumHeight / 2)+((ball.getPosition().y) /2) - (FrustumHeight /2); ...
4
votes
2answers
2k views

Viewport / Camera Calculation in 2D Game

we have a 2D game with some sprites and tiles and some kind of camera/viewport, that "moves" around the scene. so far so good, if we wouldn't had some special behaviour for your camera/viewport ...
4
votes
1answer
863 views

2D Camera Acceleration/Lag

I have a nice camera set up for my 2D xna game. Im wondering how I should make the camera have 'acceleration' or 'lag' so it smoothly follows the player, instead of 'exactly' like mine does now. Im ...
4
votes
1answer
344 views

Getting the Bounds of a 2D Cameras View with Zoom

I am using a 2D camera, which does rotations and zoom. Currently, I am using the following to get my MinX, MinY, MaxX and MaxY... public float MinX { get { return ...
4
votes
1answer
68 views

Lighting computation viewing direction

This is something that's really cooking my noodle. When I'm computing the light response for a material in my fragment shader, I'm using the standard 3 normalized vectors, in eye space: fragment ...
4
votes
3answers
283 views

Why does Unity in 2d mode employ scaling and the default othographic size the way it does?

I previously used SFML, XNA, Monogame, etc to create 2d games, where if I display a 100px sprite on the screen, it will take up 100px. If I use 128px tiles to create a background, the first tile will ...
4
votes
1answer
758 views

Improving first person camera and implementing third person camera

I want to improve upon my first person camera implementation and extend it to, so the user can toggle between third person/first person view. My current setup: draw():: glPushMatrix(); ...
4
votes
1answer
908 views

FPS Camera Look Direction

I'm using XNA to create an FPS camera that uses a Direction vector instead of a Target vector control the camera's orientation. I'm having trouble with the math for looking up and down when the ...
4
votes
1answer
368 views

How do I ensure that perspective and orthographic projection matricies show objects at the same size on the screen?

I am working on a 3d scene editor and would like to show the scene in orthographic projection. My current problem is that I am not sure how to calculate the orthographic projection matrix such that ...
4
votes
2answers
1k views

Camera chasing player

I want the camera to follow the player and lag a little bit and then catch up with the player when the player halts. When stopped the player is in the center. At the moment im at the point where i ...
4
votes
1answer
350 views

How do I calculate the boundary of the game window after transforming the view?

My Camera class handles zoom, rotation, and of course panning. It's invoked through SpriteBatch.Begin, like so many other XNA 2D camera classes. It calculates the view Matrix like so: public Matrix ...
4
votes
2answers
245 views

Render a 3D scene in multiple windows - extended panoramic view

Is there any resource location on how to view a 3D scene from an application or a game on multiple windows or monitors? Each window should continue drawing from where the neighbouring one left off (in ...
4
votes
4answers
1k views

From camera coordinates to world coordinates

I want to calculate world coordinates from camera coordinates. However, I seem to have problems with my understandings of how matrices in HLSL work. From world to camera is clear: cameraPosition = ...
4
votes
1answer
347 views

Handling cameras in a large scale game engine

What is the correct, or most elegant, way to manage cameras in large game engines? Or should I ask, how does everybody else do it? The methods I can think of are: Binding cameras straight to the ...
4
votes
3answers
192 views

How do I change the relative origins of a Box2D World and a TiledMap in Libgdx?

I'm playing around with Box2D and TiledMaps and I've come across this minor annoyance. As you can see, both Box2D and TiledMap render at the center of the screen. This forces me to compensate by ...
4
votes
1answer
549 views

Issues implementing arcball viewer

My scene has a simple cube, and a camera built with the lookAt function (I'm using OpenGL). The scene renders fine, and I'm sure I have my model/view/projection matrices set up correctly. Now I'm ...
4
votes
1answer
1k views

Orthographic Camera Zooming

In XNA I am using a spritebatch to render a board. I have created a camera class which can provide me a view and projection matrix. Currently I am supplying the view matrix to my sprite batch when I ...
4
votes
3answers
562 views

Zelda LttP (Super Nintendo) room changes?

I'm trying to make a tile-world adventure game on iOS similar to Zelda Link to the Past on SNES, and one issue I've run into is having my camera move beyond walls revealing the rooms on the other ...
4
votes
1answer
1k views

Obtaining a world point from a screen point with an orthographic projection

I assumed this was a straightforward problem but it has been plaguing me for days. I am creating a 2D game with an orthographic camera. I am using a 3D camera rather than just hacking it because I ...
4
votes
1answer
378 views

3D Camera Problem

I allow the user to look around the scene by holding down the left mouse button and moving the mouse. The problem that I have is I can be facing one direction, I move the mouse up and the view tilts ...
3
votes
1answer
1k views

Can a 4x4 matrix describe a camera's perspective?

I'm working with a closed-source 3D engine, and it only allows you to set the view projection via a 4x4 matrix. Can this matrix describe the camera's translation, rotation & perspective? I turned ...
3
votes
2answers
336 views

How do I get started with fog type effects in a first person game?

Hey guys, I'm currently using JME3 to learn 3d game development in java, and I have run into a situation. I would like to add fog effects to my games, but I don't even know where to start to implement ...
3
votes
1answer
5k views

3D Ray Casting / Picking

I am not sure if I should post this link, but I feel this falls into game development just as much as it does math. I have a ray cast's far and near values and I am trying to calculate the end point ...
3
votes
3answers
152 views

Smooth interpolation with variable time steps

My game engine just went through a small overhaul that changed its fixed time step loops into variable time steps ones. Though everything has already been adapted steadily to the new environment, ...
3
votes
2answers
5k views

How To Smoothly Animate From One Camera Position To Another

The Question is basically self explanatory. I have a scene with many cameras and I'd like to smoothly switch from one to another. I am not looking for a cross fade effect but more to a camera moving ...
3
votes
1answer
3k views

How do I create a bounding frustum from a view & projection matrix?

Given a left-handed Projection matrix, a left-handed View matrix, a ViewProj matrix of View * Projection - How do I create a bounding Frustum comprised of near, far, left, right and top, bottom ...
3
votes
1answer
323 views

Should the camera's rotation value be clamped?

I noticed that when writing a camera for my 2D game that the camera rotational value of -6 and 6 is equivalent to 0. That is, -6 = -12 = -18 = -24 = 6 = 12 = 18 = 24. I was wondering if it was ...
3
votes
3answers
824 views

2D XNA game Camera issue

I'm currently making a 2D Worm-clone in XNA, and have regrets about the way I've made my camera. I declare my camera in my Main class and the camera follows the player. In my draw I then begin my ...
3
votes
1answer
194 views

“Pixel-perfect” camera positioning in 2d game

I am writing a 2d game using LibGDX. The view to the game world is top-down. The game shows a grid of lines, which looks nice when the camera is at its initial position (0,0). The problem is now that ...
3
votes
1answer
111 views

Vertices shaking with large camera position values

Basicly when i set the position of my camera (my character in game) to a high value, the geometries seems to be shaking, the higher the position value, the more they shake. On low position values you ...
3
votes
1answer
565 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 ...
3
votes
1answer
582 views

3D zooming technique to maintain the relative position of an object on screen

Is it possible to zoom to a certain point on screen by modifying the field of view and rotating the view of the camera as to keep that point/object in the same place on screen while zooming ? Changing ...
3
votes
2answers
2k views

Implementing camera for 2d side scroller game?

I'm implementing a 2D side scroller for iOS (using C/C++ with OpenGL) (beat'em up style like double dragon/final fight ). My scenes are composed of one cyclical background image ( the end of the ...
3
votes
2answers
171 views

Three Screens = Three Cameras?

I have three screens which are at an angle to each other. Basically, the left and right cameras need to move relative to the main camera in such a way that it would look like each screen is a window ...
3
votes
2answers
4k views

Game Maker: How do I make a score display move with the view?

I have drawn everything needed to the screen including a HUD for the score, but I have my room set to follow my player: When the camera follows the player, the score HUD stays doesn't scroll with him! ...
3
votes
1answer
634 views

Perspective projection with 90 degrees between X-Y axis?

I'm trying to create a game that mimics Tibia's projection style: , As you can see, a 3d point is mapped to 2d like this: So I've downloaded Three.JS and a lib to create a Orthographic Camera. But ...
3
votes
2answers
1k views

3D camera implementation

I've been bashing my head against the concept of a 'camera' for my 3D world for some time now, and I'm not sure I'm doing this right anymore. Maybe I've been working on this for too long and have ...
3
votes
1answer
187 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; ...
3
votes
1answer
2k views

Orbiting a specific point - Orbiting Camera

How would I create a camera that with the mouse, it allows you to orbit around a specifc position, with the camera always facing that point? I would also like it to be able to always be at a constant ...
3
votes
1answer
222 views

Is there a standard camera position / orientation?

I've come across a need to position a camera for an arbitrary (unknown) scene. The camera can be updated later, but I thought I'd give it a reasonable default, and the thought crossed my mind that ...
3
votes
2answers
2k views

Help me get my 3D camera to look like the ones in RTS

I am a newbie in 3D game development and I am trying to make a real-time strategy game. I am struggling with the camera currently as I am unable to make it look like they do in RTS games. Here is my ...