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
104 views

Pygame Scrolling Map

I have two questions. I'm working in a rogue-like and I've manage to implement a camera on the player, the camera shows just the players surroundings and is fixed in the side of the windows. The ...
4
votes
1answer
71 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 ...
0
votes
1answer
241 views

Libgdx Do a fixed rotation for orthographic camera

Im trying to rotate my orthographic camera in the render loop to a fixed angle, but I can only make the camera spin with the code I got: in the create OrthographicCamera camera = new ...
0
votes
0answers
36 views

Is it possible to mask over CameraUI AS3?

My idea is to use the CameraUI to take a photo and then transpose that photo onto a blank sprite. So I want to have a mask layer over the CameraUI to line up the object with the size of the sprite. ...
1
vote
1answer
162 views

How do I create a camera?

I am trying to create a generic camera class for a game engine, which works for different types of cameras (Orbital, GDoF, FPS), but I have no idea how to go about it. I have read about quaternions ...
1
vote
1answer
312 views

How to prevent showing outside of Game Map ( Cocos2D-x ) ( Scrolling game )

I'm trying to make a tower defense game and it can zoom in/out and scrolling over my world map. How to scroll over the game and how to restrict it not to show outside of my map(black area). At below ...
15
votes
2answers
1k views

Camera vs Viewport

I'm don't have a clear understanding of what precisely is the difference between the camera coordinates and the viewport coordinates. Can anyone please clarify?
0
votes
1answer
104 views

Implementing Camera Zoom in a 2D Engine

I'm currently trying to implement camera scaling/zoom in my 2D Engine. Normally I calculate the Sprite's drawing size and position similar to this pseudo code: render() { var x = sprite.x; ...
0
votes
1answer
253 views

Change players state and controls in-game

I'm using Unity 3D Let's say the player is an ice cube. You control it like a normal player. On press of a button, ice transforms (with animation) into water. You control it completely different than ...
1
vote
1answer
681 views

OpenGL - Calculating camera view matrix

Problem I am calculating the model, view and projection matrices independently to be used in my shader as follows: gl_Position = projection * view * model * vec4(in_Position, 1.0); When I try to ...
2
votes
1answer
79 views

Why are my 2D world click-positions offset after camera movement?

I'm writing a 2D game engine. I need to add a camera to my world that can zoom in and out as well as move away from its initial position at (0,0) at the center of the world. The main issue can be ...
0
votes
0answers
51 views

Issue with turntable rotation openGL

I am trying to implement turn table like rotation in my openGL app. In turn-table like rotation, z-axis is not supposed to roll. But in my app z-axis rolls like anything when I try to rotate the ...
1
vote
1answer
690 views

Displaying streaming video on dynamic texture

We are working in Unity 3D on pro licence and we are faced with the task to display streaming video as a dynamic texture in out Unity3D web project. We have a standard IP-camera , which is capable of ...
6
votes
3answers
599 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 ...
0
votes
0answers
105 views

How do I find the camera direction vector for 3D sound purposes? (C++, DirectX)

Question I'm trying to make a sound class for playing 3D sound effects with DirectSound and DirectX, without using DirectSound's 3D libraries. The plan is to have every game object constantly play ...
0
votes
0answers
29 views

Why doesn't my game start in landscape mode?

I want my game to run on all Android devices in LANDSCAPE_FIXED mode, but this mode works only for some screen resolutions. PORTRAIT_FIXED works well for all devices. I'm testing this on and emulator. ...
0
votes
2answers
361 views

Smooth camera movement between followed objects

I have 2d game where my camera follows the player. Simplified, it copies the player position as its own. Now I have some other object in the game, that I want to camera to follow. This is easy enough ...
0
votes
1answer
230 views

Background Sprite Setting

For my 2d game, I want to set background image. So that I am using multiple background images for that purpose. But it can't set correctly on screen that illustrated in following image. Also for ...
0
votes
1answer
138 views

Free Look Camera Like Arma 2 while pressing ALT [closed]

I'm trying to create a simple script that give me the possibility to rotate the camera while pressing a key. So, in a pseudo-code way, how I can intercept the Input event and limit the player's ...
1
vote
1answer
395 views

LibGDX keep camera within bounds of TiledMap

I have a simple TiledMap which I can render fine. I have a player hopping (with Box2D) around and my camera follows the player around: cam.position.set( player.position().x * Game.PPM + ...
0
votes
2answers
69 views

Why does my side-scroller character move in the wrong direction?

I'm trying to understand why my rectangle moves in the opposite direction I want it to. I have a float for translation: glTranslatef(translate_x, 0, 0); if ...
0
votes
2answers
505 views

openGL Camera setup for Zoom in/out centered at point under cursor

I am trying to implement a zoom in/out navigation mode in a openGL 3dViewer. I was able to implement zoom functionality centered at screen center just by moving eye towards the center in perspective ...
0
votes
2answers
78 views

Player's camera, how to obtain smooth movement

In a 2D platformer, I have a player that can move both horizontally and vertically. I also have a camera that moves in relation to player. In every update I do this: public void RepositionCamera() ...
0
votes
1answer
72 views

Incomplete mesh using DrawIndexedPrimitives after rotating mesh

Through help on this site I was able to draw the triangles of an unrotated, nonscaled nontransformed mesh created in Blender and exported to OBJ, accurately imported through Assimp and rendered in XNA ...
1
vote
1answer
296 views

Unity 2D camera drifts from player as speed increases

I have a dilemma that I did not have in XNA before porting my game to Unity. First-- my goal is to mimic Super Mario World 2's camera tracking in x. The camera tracks to 1 block ahead of the player, ...
1
vote
5answers
354 views

What is this type of camera called?

I am trying to find a name like "perspective view" of how a camera like this is called: It is 2d and 3d at the same time. I'm having a hard time trying to find the name.
0
votes
2answers
145 views

what function creates rotation effect in three.js?

which part of the code is responsible for the rotation in this example? Is it the camera or the scene itself? http://threejs.org/examples/#canvas_camera_orthographic
0
votes
1answer
89 views

Camera rotation around point, but without centering

Let's say i have the following: Point somewhere in space Camera with position and orientation (up, right, forward) I want to rotate camera around the point, but also keep this point in same place ...
2
votes
1answer
255 views

Generating transformation matrix for 2D camera with pan/zoom/rotate

Question How do you implement a camera with pan/zoom/rotation for a 2d game? Is it acceptable to multiply together a series of transformation matrixes to generate a final transformation matrix that ...
0
votes
0answers
127 views

Shifting the camera and setting a new scene when using Box2D

My jsFiddle: // START -- MOVE CAMERA var p = new b2Vec2(); p = (ball.body.GetWorldCenter().x) * physics.scale; pos.push(p); var length = pos.length; var s = (pos[length - 1] - pos[length - 2]); //in ...
0
votes
0answers
51 views

Focus a turntable style camera on an object

I have a turntable style camera in the maya / blender / alembic / opensubdiv example. I want to be able to match the camera translation to any objects translation pivot point in the scene and then ...
4
votes
1answer
212 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 = ...
2
votes
1answer
86 views

Camera roll has no effect

Consider my following (abstracted) C# w/ SharpDX code: class Game { Camera _camera = new Camera(); private void Window_KeyDown(object sender, KeyEventArgs e) { // Roll if ...
0
votes
2answers
197 views

How do I efficiently determine what objects are visible to a camera?

I want to call the rendering methods of only the game objects that are visible. How can I efficiently determine which objects or tiles are within the camera's rendered region?
1
vote
1answer
202 views

How do I fix my planet-facing camera?

Summary I'm having trouble implementing a camera controller suitable for first person use around a planet. The camera needs to be oriented correctly according to gravity (vector from camera ...
0
votes
0answers
60 views

3D model editor manipulators

I'm trying to make my own 3D model editor to better learn 3D programming. I have my translate manipulators and I'm trying to calculate the Vector2 that the mouse would have to move in order to move an ...
0
votes
2answers
169 views

FPS camera specification

I remember I once composed a FPS viewing transformation, as a composition of 3 rotations, each with an angle as a parameter. The first angle specified the left/right rotation around the y-axis, the ...
0
votes
0answers
367 views

Irrlicht - Camera rotation like FPS

I'm constructing a game in OpenGL and initially I started using GLUT for the general purposes. However, later on I bumped over the problem of 3D model import and, after so many time trying to import ...
2
votes
0answers
66 views

How to set “near” value properly?

Usually, the camera's near value is set to sth like 0.1f. However, this (assuming 1.0f = 1 metre) makes everything that's closer than 10 cm from the camera invisible. On the other hand, when working ...
0
votes
1answer
109 views

Strange quaternion camera streching in WebGL

So after a lot of researching about quaternions I almost got the quaternion camera working. Almost, cause it rotates in a proper way only in a vertical axis. Other rotations stretches and deforms the ...
0
votes
0answers
133 views

Box2dLights rendering in bigger scale

So basically my box2dLights are rendering in wreid places. The circle in center is my player and as you can see lamp which should be aligned to player is in the right-top corner. my code: package ...
2
votes
1answer
438 views

3D Camera Rotation

Please, forgive me, but I need help and I've been stuck on this for a few weeks now, I'm making no progress and everywhere I go and I see a different answer, everything I try doesn't work. I've had ...
1
vote
0answers
91 views

3D Camera Y-Axis wrong angle

I am trying to build a camera class, though I am running into a problem. When I move the camera above/below, and try to move towards the ground, I am moved off in what seems to be about 45 degrees in ...
0
votes
1answer
60 views

How to realize a camera that is following the player [duplicate]

I want to create a simple space game, like Asteroids. Unlike Asteroids, the map is supposed to be larger than what the player can see: The grey part is what the player can see in the game window, to ...
4
votes
3answers
257 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 ...
0
votes
0answers
31 views

Checking if a object is blocking my view of a light (it's between light and camera)

I'm trying to determine, from a list of objects, which ones are blocking my view of a light. In other words: which ones are between the light and the camera. Coding in C++, using HPL1Engine. This is ...
1
vote
0answers
61 views

Texture visualization problem on camera movement (xna)

I'm trying to move a camera over a model that is used as the floor of the game. When I move the camera, the texture of the model is not showing correctly (video of the problem: ...
0
votes
1answer
324 views

First person camera world matrix issue (in THREE.js and webGL)

I'm trying to create a Portal-like effect in webGL using THREE.js. I have two scenes connected by a pair of portals. The view of the 2nd scene in rendered inside the 1st portal using stencils and ...
0
votes
1answer
384 views

How do I determine the look-at vector of a free-look camera?

I'm trying to create a free-look camera with DirectX 10. I've figured out how to get the directions for forward and back and left to right. However, I don't know how to rotate the look-at vector of ...
1
vote
1answer
197 views

What are the types of 3rd-person camera called?

I'm struggling with the terminology surrounding different types of 3rd person camera. What are the common 3rd-person camera types called? What are some notable examples of their use? Here's what I ...