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

learn more… | top users | synonyms

1
vote
1answer
95 views

Drawing chunks, and positioning the camera

I've seen many questions and answers regarding how to draw tiled maps but I can't really get my head around it. Many answers suggest either loading the visible part of the map, or loading and ...
1
vote
1answer
118 views

Automatically zoom out the camera to show all players

I am building a game in XNA that takes place in a rectangular arena. The game is multiplayer and each player may go where they like within the arena. The camera is a perspective camera that looks ...
0
votes
1answer
190 views

Obtain rectangle indicating 2D world space camera can see

I have a 2D tile based game in XNA, with a moveable camera that can scroll around and zoom. I'm trying to obtain a rectangle which indicates the area, in world space, that my camera is looking at, so ...
0
votes
1answer
301 views

How to code camera for layered map in unity

For a current unity project I need a layered map like in Dwarf Fortress. The game will take place in a 3D city enviroment and the camera should be 'snapped' to layers. So there will be (for example) a ...
1
vote
3answers
126 views

Can I use a translate function to implement a viewport?

I read this great question and its accompanying great answer about rendering a viewport in a top down 2D game: As for actually drawing the objects the camera can "see", you now draw all objects ...
2
votes
4answers
253 views

How do I rotate a camera around the Y axis of the object it's looking at? [duplicate]

I'm making a camera that can currently rotate freely from the back to the front of a target object by giving it an angle and a distance. I do the above with the following code directionVector = ...
0
votes
0answers
56 views

camera panning problems with “modelviewer” camera

I have a camera that rotates around a center point using a rotation matrix and radius for the zoom from the object. I need to add right mouse button panning in. Here is the problem: when I change ...
0
votes
1answer
436 views

Simulate camera movement in two dimensions (OpenGL)

I've been told by the folks over at Stack Overflow that there's no way to move the camera in OpenGL. I'm developing a 2D RPG with LWJGL and need to know the proper way to simulate camera movement as ...
0
votes
1answer
151 views

Adding Functionality to a basic Java 2D Camera

Creating a little LoZ inspired game in Java here just to get into the feeling of things (learning CS at my school but the only teacher who's willing to help is travelling for 6-months, so I'm teaching ...
0
votes
0answers
118 views

Why my camera sees what is behind it?

I am building a minimal opengl viewer and I am puzzled by what I see : the camera see the (test) object that is behind her. the front and back of the camera looks reverted. I am wondering what could ...
0
votes
1answer
208 views

OpenGL camera translate and rotate on cameras local axis

How can I make rotation and translation on a local camera axis in OpenGL? I want to make camera like "aeroplane" camera with a pitch yaw and roll. I want to have good explanation on everything! Can ...
0
votes
1answer
237 views

XNA Zoom in/out on model instead of scaling the model

I'm trying to implement zoom in/out functionality into my game. I can change the cameraDistance value with the Z and X keys. Instead of zooming, it looks like the model is scaled smaller or larger ...
0
votes
1answer
274 views

XNA Arcball and moving model - the model is altered instead of the camera

I'm trying to implement an arcball type camera, I've got all controls working very nicely. I can rotate the X/Y axis with my mouse and zoom in and out with the Z/X keys. The problem is, that the ...
0
votes
1answer
436 views

switching from third person view to first person view

I have done a scene in opengl where I'm using a third person camera (that I can control with the mouse). Then, inside it, it has the camera of the first view (that I called thirdpersonCamera, see the ...
2
votes
2answers
280 views

Player jitter when positioned at large coordinate values

I am trying to make a simple top down scrolling shooter using Unity3D comprising of the following elements: 1) Top down orthographic camera: points at 65 degrees towards the ground. At a height of ...
3
votes
1answer
580 views

How to smoothly change the target of smooth follow without camera glitch?

I am trying to change the target of the smooth follow at runtime, but there is a glitch in the camera since the targets are different sizes. I tried using lerp and smooth damp both gave the same ...
1
vote
1answer
158 views

Cartesian Coordinates & Layout [duplicate]

The way cartesian coordinations are presented and used is kinda confusing. When working with 2D the vertical axis is Y, though when working with 3D the vertical axis is Z and Y becomes the "depth" ...
0
votes
1answer
81 views

How to rotate the camera to point to a specified location?

I have a quaternion based camera class (which controls a view matrix) and would like a function to rotate the camera to face a specified point. The best approach I can come up with is that I rotate ...
0
votes
1answer
150 views

Orbiting a camera around the Y axis whilst remaining up

I've been having difficulty with a problem which I thought was going to be a simple solution. I have a camera facing downwards on a character. The can camera be lowered and when it's lowered it ...
1
vote
2answers
326 views

Rotate around the centre of the screen

I want my camera to rotate around the centre of screen and I'm not sure how to achieve that. I have a rotation in the camera but I'm not sure what its rotating around. (I think it might be rotating ...
1
vote
0answers
95 views

Determining axis to rotate around

I'm trying to implement a free-look third person camera (using glm). I know that the general transformation is newCameraPosition = translate(lookatPoint) * rotation(angle,axis) * ...
0
votes
1answer
226 views

First person shooter camera movement

I am making an FPS in XNA. I cannot seem to make a FPS camera that I can move Forward, Back, Side to Side using the keyboard. How do I do that?
0
votes
2answers
502 views

First person camera: problem

I have created a simple camera class, moved it from my C# (XNA) source to C++ for d3d. Commonly it is okay, but something is wrong with rotation. If i increase its pitch/yaw values, according to ...
1
vote
1answer
547 views

Understanding the z-axis vector from OpenGL modelview matrix

I would like to shoot spheres in the current view direction in a simple scene. I use an FPS camera, so no z-rotation. The vector pointing in the correct direction should be (m[8], m[9], m[10]) where m ...
2
votes
2answers
237 views

Field of view settings for first person shooter

Are there any industry standards for setting the field of view (FOV) for FPS games or is it solely based on trial and error? Are there any guidelines for choosing the correct value?
3
votes
1answer
875 views

Second camera record and export to video file (Unity)

I'm making horror quest game for PC on Unity. I'm trying my best to make it kind of unique and trying not to use standard methods like screamers etc. What i want to do badly is camera recording ...
-1
votes
1answer
182 views

Pinhole matrix problem

I made a program to represent a 3D world. I use the projection matrix we can find on wikipedia. For viewing a scene it's very nice but when I straff in the scene, everything behind the camera go on ...
10
votes
2answers
4k views

XNA 2d Camera Scrolling - why use matrix transform?

I am making a test game where I want the level to be constantly scrolling. To create this effect I have established a camera class which simply stores a vector2 position and an enum direction. It also ...
4
votes
1answer
161 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 = ...
0
votes
2answers
400 views

How do I implement a 2D camera in JPanel?

I'm trying to create a mario-esque game in Java and am at the point of implementing a camera. Following normalocity's example, I understand the difference between the GameWorld and the Camera that ...
0
votes
1answer
720 views

Camera Matrix Transform to scroll through level - Monogame, XNA

I am trying to change the way I scroll through a level. Currently I have a static camera class which stores a direction enum and a vector 2 position. This class then has a method to move the position ...
0
votes
2answers
93 views

Need transform matrix to translate the center of the view to a custom position within the target texture

My problem is as follows: I want to use a single render target texture for drawing 16 viewports where I want to display the 16 different combinations of the marching squares algorithm with my 3D ...
1
vote
3answers
66 views

2D Camera doesn't work when I have split my code into DrawableComponents

I have the following camera written: public class Camera { public Vector2 Position; Viewport Viewport; public Matrix Transformation { get { return ...
6
votes
1answer
182 views

How to prevent clipping when moving through a tunnel?

I'm developing for Android using OpenGL ES 2.0. It's going to be a game where you have to fly through a tunnel without hitting the walls. However, the tunnel wall gets clipped as the player ...
1
vote
1answer
452 views

Quaternions, Axis Angles and Rotation Matrices. Which of these should I use for FP Camera?

After 2 weeks of reading many math formulas and such I know what is a Quaternion, an Axis Angles and Matrices. I have made my own math libary (Java) to use on my game (LWJGL). But I'm really confused ...
1
vote
1answer
1k views

How to set orthgraphic matrix for a 2d camera with zooming?

I'm using ID3DXSprite to draw my sprites and haven't set any kind of camera projection matrix. How to setup an orthographic projection matrix for camera in DirectX which it would be able to support ...
1
vote
2answers
341 views

Creating a 2D perspective in 3D game

I'm new to XNA and 3D game development in general. I'm creating a puzzle game kind of similar to tetris, built with blocks. I decided to build the game in 3D since I can do some cool animations and ...
2
votes
1answer
843 views

Problem using glm::lookat

I am trying to rotate a sprite so it is always facing a 3D camera. Object GLfloat vertexData[] = { // X Y Z U V 0.0f, 0.8f, 0.0f, 0.5f, 1.0f, -0.8f,-0.8f, 0.0f, ...
2
votes
1answer
281 views

Frustum culling with third person camera

I have a third person camera that contains two matrices: view and projection, and two Vector3's: camPosition and camTarget. I've read up on frustum culling and it makes it seem easy enough for a first ...
0
votes
0answers
77 views

Lwjgl camera causing movement to be mirrored

I'm having a problem in that everything is rendered and the movement is fine. However, everything seems to be mirrored. In the sense that the TriangleMob should move towards me, but it doesn't instead ...
0
votes
1answer
84 views

XNA Rendering vertices that only appear within the cameras view

I'm making a game in XNA and I recall hearing that professionally made games use a technique to only render the polygons that appear within the cameras projection. I've been trying to find something ...
1
vote
2answers
266 views

What should I consider when selecting a field-of-view (FOV) for a space game?

I am making a space game (like the game Freelancer). You control a space ship in third person. What are some gameplay considerations that I should weigh when selecting a field-of-view (FOV) for such ...
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 ...
3
votes
1answer
118 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 ...
0
votes
1answer
106 views

3D drawing precision problem. XNA

I have a simple scrolling camera positioned 2000 units about the 3D 'floor' that moves forward by 1 unit every frame and looks down on the floor at a point that also moves forward by 1 unit every ...
1
vote
1answer
222 views

Creating big scene and little size chasing camera

I would like to create a climb based game, so I need to have a big scene and a camera that cover only a little part of it and chase my player. This image explains easier what I want: How can I do ...
2
votes
3answers
2k views

How do I position a 2D camera in OpenGL?

I can't understand how the camera is working. It's a 2D game, so I'm displaying a game map from (0, 0, 0) to (mapSizeX, 0, mapSizeY). I'm initializing the camera as follow : Camera::Camera(void) : ...
-1
votes
1answer
444 views

Android OpenGLES 2 ray picking, resulting coordinate jumpy in certain spots?

I am trying to implement object picking based on touch coordinates via an intersecting ray test. I am having trouble finding information on converting the touch coordinates to the coordinate system ...
0
votes
1answer
355 views

Drawing the same scene with perspective then orthographic projections

I have a scene that I'm rendering first with a perspective matrix. I then want to rerender it in a different viewport using an orthographic matrix for a top-down 2D view of the scene. I think I may be ...
0
votes
1answer
88 views

What values to construct “Projection Matrix” from?

I am curious to what standard values I should use to create a camera's projection matrix, as well as if certain measurements need to be taken if I want to represent a very small world or a very big ...