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

Moving player in direciton camera is facing

I have a 3rd person camera which can rotate around the player. My problem is that wherever camera is facing, players forward is always the same direction. For example when camera is facing the right ...
0
votes
2answers
246 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 ...
4
votes
3answers
185 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 ...
6
votes
1answer
709 views

What are some good methods of implementing RTS-style Box selection?

I'm scouting around for different methods of implementing a typical RTS box selection. This is for 3D game - so I'm looking for methods for finding units within selection box in 3D world. Here is a ...
0
votes
1answer
44 views

Problem with sprite direction and rotation

I have a sprite called Tool that moves with a speed represented as a float and in a direction represented as a Vector2. When I click the mouse on the screen the sprite change its direction and starts ...
0
votes
1answer
45 views

Rotating a view of a chunked 2d tilemap

I'm working on a top-down (oblique) tile-based engine. I would like for the tiles to have a definable height in the world, with Characters being occluded by them, etc. This has led to a desire to be ...
0
votes
1answer
175 views

LWJGL: Camera distance from image plane?

Let me paste some code before I ask the question... public static void createWindow(int[] args) { try { Display.setFullscreen(false); DisplayMode d[] = ...
1
vote
1answer
68 views

Libgdx 2D Game, Random generated World of random size, how to get mouse coordinates?

I'm a noob and English is not my mothertongue, so please bear with me! I'm generating a map for a Sidescroller out of a 2D-array. That is, the array holds different values and I create blocks based ...
0
votes
2answers
152 views

Java: Camera Rendering

Which is the best way to detect whenever an object or tile is inside the Camera Range so I can draw it? With "best" I mean more efficient, and quicker. Thanks
0
votes
0answers
41 views

different screens and cropping problem

I have an image that look like this in unity: but in my htc desire 500 mobile phone look like this, even in my tablet: it crops a lot. In landscape mode it is better but i have the same problem. ...
1
vote
2answers
173 views

How can I keep chase camera behind player when player rotates?

I have implemented a follow camera in Unity 3D. However, if the player object rotates, the camera does not rotate with it. To fix this I used RotateAround as follows: playerRotation = ...
0
votes
1answer
38 views

Doing a turntable camera animation on a world matrix rather than view matrix

I have a camera class that contains a 4x4 view matrix as a member variable. Most of my camera controls work fine when doing them directly on the view matrix. In an attempt to unify all of my scene ...
1
vote
1answer
62 views

How to implement camera pan like in Maya?

I am trying to implement camera pan like the one in Maya. I've got it almost working. The problem is that the mouse cursor is moving faster than the 3d mesh (in fact I am moving the camera but I ...
0
votes
2answers
144 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 ...
1
vote
1answer
196 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 , ...
0
votes
1answer
64 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 ...
2
votes
1answer
170 views

Orthographic Camera and Raycasting in Three.js

I'm working on a test project porting a simple game from iOS to Javascript. I've got the orthographic camera working and it can view the objects in the scene and move up and down the tower of meshes ...
1
vote
1answer
164 views

Camera movement and threshold not working

I have a platformer that is in progress, part of this has a camera which I only want to move when the character moves out of a certain threshold, to try to accomplish this I have the following if ...
1
vote
2answers
55 views

Setting up a camera to make the world look large

I am attempting to configure my camera to give the impression of a normal sized player in a giant room. Since units are arbitrary, I figured this should be possible (despite the fact that the room is ...
0
votes
1answer
122 views

Angled topdown perspective camera for 2.5d game

I have a 2d tile based game created using Unity's 2d tools and orthographic camera: The tiles are created by programmatically generating a mesh, assigning a texture to each pair of triangles, and ...
0
votes
1answer
254 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 ...
0
votes
0answers
35 views

Add terrain collision and fix axis of camera

I made 3rd person camera script which works ok but needs few tweaks which I don't know how to fix. I'm using controller/ joystick. -Firstly, camera has this issue: when I look at the back of the ...
0
votes
1answer
148 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 ...
0
votes
1answer
130 views

On Screen Coin Animation

am working with side scrolling skater game. I want to perform coin animation such that as player collect coin it moves upside and attach with currency sprite. My main character and coin present in ...
0
votes
1answer
125 views

Lock mouse in center of screen, and still use to move camera Unity

I am making a program from 1st person point of view. I would like the camera to be moved using the mouse, preferably using simple code, like from XNA var center = this.Window.ClientBounds; ...
3
votes
1answer
187 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 ...
13
votes
6answers
2k views

Creating a seamlessly looping 2D multiplayer level?

A discussion came up recently about how to create a 2D side-scrolling multiplayer game that can have an looping level design (Think of Starbound and how their worlds are looping). I thought the ...
0
votes
0answers
20 views

how do I know what blocks to draw in a lightweight Minecraft style game [duplicate]

I am creating a lightweight minecraft style test game in C++ using opengl es. I have come upon a problem while planning it though - what is the most efficient way to render blocks? I know about back ...
-2
votes
0answers
46 views

Quaternion Matrix Camera Example in LWJGL

Does anyone have an example of a quaternion matrix camera for use in LWJGL? I have been looking for months now and I cannot find a single complete example that contains an update function (showing how ...
0
votes
0answers
22 views

changing camera's reference point position by a keyboard event

I would like to change the camera's reference point position using gluLookAt. I would like that it changes when I press for exemle 'a'. I tried with: void VueOpenGL::Paint(wxPaintEvent&){ ...
0
votes
0answers
32 views

Unity game view differs from scene view?

I have an issue in which Unity is not showing the Game view in accordance to that of my Main camera despite setting them up as such in the photos. Would appreciate if someone could tell me where I ...
0
votes
0answers
39 views

2D Orthographic camera movement clamp in any orthographic size

I have a problem, which i currently can't figure out how to solve. I am trying to calculate a clamp value for world coordinates which have to respect any camera orthographic size.I bought an image ...
0
votes
1answer
140 views

Camera controller in a 2d platformer

I'm basically bumming around using Unity's 2D creation tools, and I've managed to create a little platformer physics demo. There's a lot of work to be done, but I've got basic movement down, some ...
1
vote
1answer
173 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 ...
2
votes
1answer
148 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 ...
9
votes
3answers
3k views

Why the clip space in OpenGL has 4 dimensions?

I will use this as a generic reference, but the more i browser online docs and books, the less i understand about this. const float vertexPositions[] = { 0.75f, 0.75f, 0.0f, 1.0f, 0.75f, ...
0
votes
1answer
97 views

TiledMap not drawing completely [closed]

While attempting to constrain camera scrolling to within the TiledMap I discovered that it seems the renderer for the map is not drawing the entire map. The map is 1600x960px so one would assume the ...
1
vote
1answer
39 views

Fit a bounding box in the scene modifying FOV

Suppose I have a radius for a spherical bounding box around a mesh. My goal is to render the scene such as when the camera moves, the bounding box whose centre the camera look at, occupies always ...
1
vote
0answers
67 views

OpenGL/GLM Camera

I want to make a camera that can freely look and walk on X/Z plane and rotate 360 degrees. I'm using OpenGL and the lookAt function from the GLM library to create the view matrix. I've looked through ...
0
votes
0answers
64 views

MonoGame - Fuzzy Pixels When Drawing (2D)

I apologize if this has been answered somewhere; I spent quite awhile searching but couldn't find an answer. I have any issue with my 2D sprites being drawn to the screen - either the non-moving or ...
1
vote
0answers
61 views

How would I warp a mesh with code?

I recently asked a question about putting a camera at the head of a 3D human model here and it worked out rather well and whatnot, but there is still a problem that bothers me: How would I ...
1
vote
0answers
25 views

Scale aware adaptive camera zooming

I would like to implement an interactive zoom on a 3d object with mouse wheel.A naive approach is simple where you just scale camera marix Z poistion or modify FOV.But I would like the zoom scaling to ...
3
votes
2answers
170 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 ...
1
vote
0answers
45 views

Three.js camera turning leftside right

In Three.js I am trying to implement an orbiting camera can be rotated around the x and the y axis. I am using these two functions: function rotateX(rot) { var x = camera.position.x, ...
1
vote
1answer
78 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
67 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
101 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
23 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
92 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 ...
0
votes
2answers
88 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