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

learn more… | top users | synonyms

0
votes
1answer
50 views

How to make smooth 2-d zooming

I am making a 2d game with camera zooming. Currently, my program reduces the size of each block by one. This works very well when there are only a few blocks on-screen, but not when there are ...
3
votes
2answers
33 views

How to manipulate the two variables that rotate the camera with Input.GetAxis(“Mouse X/Y”)?

A helpful fellow showed me the script for a free look camera mode that rotates with the mouse. The script is included at the bottom of the page. I want to have a system that right clicks once to ...
0
votes
1answer
22 views

Camera (pole cam) implementation problem

In my project I have simple scene graph to render whole scene and Bullet physics SDK to provide physics simulation. Each rendered object is represented as scene node. Camera always has target and ...
2
votes
2answers
116 views

Make camera follow and rotate with player without childing it

I want to have a camera, that follow the player, without childing it to the player object. So far I have this one line, that follows the player, but does not rotate with it (meaning the camera should ...
1
vote
2answers
52 views

How to use Input.GetAxis(“Mouse X/Y”) to rotate the camera?

I want to make a first person camera that rotates with the mouse. I looked at the Input.GetAxis Scripting API page and found a sample code, which I have included at the bottom of my post. Upon trying ...
0
votes
0answers
36 views

Making certain GameObjects visible for a camera

I have 2 cameras in my 2D game. One displays gameobjects normally, and the other camera draws some of these gameobjects reflected (scale.y *= -1). The reflected camera would draw only objects in the ...
0
votes
0answers
6 views

Feeding accelerometer data to vjoy

I am getting roll, pitch, yaw data from my accelerometer data. How do I map it to vJoy's appropriate axes given as X, Y, Z, Rx, Ry, Rz and Slider1, Slider2? Do I have to reverse engineer into ...
1
vote
2answers
61 views

Orthographic Camera settings for a 2D game

I'm starting out a 2D wrestling game in Unity 5 and i need some help. The default resolution of game needs to be 320x240. The background sprite that i would be using is 640x480. The camera would move ...
1
vote
0answers
25 views

Interpolate camera rotation over many keyframes smoothly

I have a defined set of rotation/position keyframes that I want a camera to animate between smoothly. Handling the position is easy enough using cubic bezier curves (and just auto-generating the ...
1
vote
1answer
35 views

How can I add a transparent overlay to a UI in libGDX?

I am attempting to use the following code shapeRenderer.begin(ShapeRenderer.ShapeType.Filled); shapeRenderer.setColor(3,3,3,.3f); shapeRenderer.rect(0,0,gameWidth,gameHeight); ...
1
vote
2answers
39 views

LibGDX - Managing a Minimap

I'm making a top-down strategy game so I thought a minimap is a must. I'm using Scene2D to display my GUI and since the minimap is technically a part of the GUI, I used the stage camera to position ...
2
votes
1answer
40 views

How to calculate if a point is contained in rectangular camera viewport with rotation?

I am working with my camera, and am trying to improve it so that I can calculate if a world point is on screen, taking rotation into account. Currently, my camera rectangle is calculated as so: ...
1
vote
0answers
14 views

Error in projecting coordinates from FitViewport to screen in LibGDX

i'm using a FitViewport to render my "game world". Viewport virtual dimensions are fixed 400x240. I use viewport.unproject method to scale input touches from screen coordinates to world coordinates, ...
0
votes
1answer
40 views

Stop rendering hidden objects libgdx

I currently am hiding objects that are not in the frustums view. However, some objects are still being rendered that are in the frustums view, but are hidden. My goal is to not render objects that ...
0
votes
1answer
97 views

How can I implement a quaternion camera?

I am trying to implement a quaternion camera in OpenGL 3.3. I have so far used these tutorials below however I have a bug which I cannot work out how to fix. ...
0
votes
0answers
41 views

LibGDX with Parallax Camera, unable to accurately select objects

So, basically I borrowed the ParallaxCamera test that LibGDX provides and got the camera set up rather nicely. However, I noticed that when I specify a speed other than 1, my game objects shifted ...
1
vote
1answer
79 views

What is next to interpolate camera position with smooth speed changes?

I am working on a path camera to be used in demo playback. (3d game) The spline math used is catmull rom. I am on my second attempt to get constant position speed :( (someone else is doing rotation). ...
0
votes
1answer
58 views

Monogame / XNA - Multple 2D Cameras (Rectangle) on screen

I recently started building a simple 2D roguelike game using Monogame 3.4. I was keen on building the game "engine" myself as I saw it as a fun learning curve. Monogame was pretty much the best option ...
1
vote
1answer
43 views

Why is the camera tilting around the z axis when I only specified x and y?

My goal is to program a camera to point towards the mouse cursor. I attached the following script to the Main Camera. using UnityEngine; using System.Collections; public class CameraController : ...
1
vote
0answers
22 views

Quaternion camera in 3D space with Pitch and Yaw

I am having trouble implementing a quaternion camera that can fly freely in 3D space with only Pitch and Yaw rotations. It works fine except when you look up or down and then try to look left or ...
-1
votes
1answer
31 views

Camera rolls instead of looking up and down

I got a small script from the official Unity forum which is: public class MouseRotationUpDown : MonoBehaviour { public float RotationSpeed = 5; void Update () { ...
0
votes
1answer
58 views

How to put the “camera” inside a cube in OpenGL

I'm really new to OpenGL and can't seem to figure out how to put the "camera" inside the cube I've created so that I can move in an FPS-like style. I tried to use gluLookAt and gluPerspective but I'm ...
-1
votes
1answer
52 views

Why is this unity camera moving in weird directions?

I have the following script public class CameraScript : MonoBehaviour { public bool AllowZoom; public float zoom; public float Speed; Transform board; void Start(){ ...
4
votes
1answer
127 views

Convert large range of numbers to a smaller scale

What is a good formula to use in order to relate two different scale distances to each other? For example, I have a camera that can have a minimum size of 2 and a maximum of 10. I would like the ...
2
votes
1answer
83 views

2D Camera sizing and movement

Apologies if this is a basic question, or been asked a 1,000 times in the past... I'm new to Unity, and having problems understanding some of the basics to do with 2D cameras (orthographic), and ...
2
votes
1answer
78 views

What can cause shadow slicing while moving camera?

Can't explain better than with video: https://youtu.be/4nIMIL6w-0M The effect I'm trying to achive is a simple fog of war. See, I have a point light casting shadows on a plane. The plane has a ...
3
votes
2answers
58 views

Unity Change Sceneview to camera view

On selecting camera, I get the camera preview. In Unity, while editing the scene, I wish to switch in such a perspective view that is exactly visible by the main camera. Is there a short cut to ...
1
vote
1answer
45 views

XNA arcball camera steering issue

I have an arcball set up to follow my model in XNA. It rotates around the target correctly when holding in the left mouse button and moving the mouse. It zooms in and our correctly with the mouse ...
2
votes
1answer
52 views

DirectX is the camera a point or a plane?

I've built an application in SlimDX using an orbit camera. Currently I treat the position of the camera as a singular point in space. I've noticed my projections from 3D space to 2d space are off by ...
1
vote
1answer
53 views

Implement dynamic 2 player splitscreen based on player positions

Having a local 2 player game, when the distance between the player is big enough, we have a splitscreen whose shape is defined by the angle between the two players. When they get close enough to each ...
0
votes
1answer
61 views

Free camera rotation in 3D space

I'm using a view matrix to do camera movement and rotation. viewMatrix = new Matrix4f(); viewMatrix.setIdentity(); Matrix4f.rotate((float) Math.toRadians(rx), new Vector3f(1,0,0), viewMatrix, ...
0
votes
1answer
35 views

OpenGL ES 2.0 basic camera issues

I am having issues with the camera, I cant find how to invert the AXIS Now A point is 0,0,0 B point is 1,0,0 C point is 0,0,1 What I want is A point 0,0,0 B point 0,0,1 C point 1,0,0 ...
1
vote
1answer
47 views

Why value 1 in OrthographicCamera viewPort width?

So, I read that camera = new OrthographicCamera(1, h/w); creates a camera with an appropriate width and height for the field view.. However, I can't understand that value 1 for the viewport width, ...
0
votes
0answers
54 views

WebCamTexture.width and height returning 16,16 unless reinitialized

I am trying to store a picture from a camera with WebCamTexture. The function Savepicture(string path) uses a Texture2D to set pixels retrieved from the WebCamTexture class field, I end up getting a ...
1
vote
1answer
28 views

6DOF camera: inverted yaw and roll when orientation changes

Whenever I change the orientation of the camera, yaw and roll become inverted (or correct); the strafing, movement and pitch do remain correct however. Can you tell what is causing this and how to ...
0
votes
2answers
133 views

A 2D Camera Follow Script That Does Not Rotate?

I am attempting to make a 2D racing game. So far I have a player car (sprite) and a main camera. I would like to know how to make the main camera follow the player car while still showing signs of ...
0
votes
1answer
46 views

Given a constant rotation and target point, find position so that point will be in camera center

Given a fixed rotation and a target "center" point, how to I find the position the camera should be in so that that point is the center? LookAt changes the rotation keeping the position constant. ...
0
votes
1answer
68 views

LibGDX full screen display mode and camera resize

I'm creating a simple 2D platformer and I have problem with my camera y position when I enter full screen mode. But first here's my code screenY = Gdx.graphics.getHeight(); public void ...
0
votes
0answers
61 views

OpenGL Diffuse Lighting Issue

I seem to have a problem in my OpenGL scene where if I (the camera) am looking at an plane it's brightness changes depending on what angle I am to the plane. It seems as though the camera is a source ...
0
votes
1answer
49 views

In Unity, what does the camera script's “Behaviour missing” error mean?

I started in Unity few days ago and made a cube with a tank control style. Now I'd like to create controls similar to 3D fighting games (Gunz, Blade Symphony, …): Control body direction with the mouse ...
0
votes
1answer
92 views

How do I rotate a cube around an axis, relative to the camera view?

I want to be able to rotate a cube, either by dragging vertically to rotate it around the Y-axis, or dragging horizontally to rotate it around the X-axis. However, when the camera is rotated 90 ...
0
votes
0answers
32 views

Rotate the camera on a given angle

Good day! I apologize in advance for my bad english. The task is as follows: "On the stage there is a camera and a gun with rays when a ray gun out of sight of the camera (vertical) is required to ...
0
votes
1answer
69 views

Pan camera within bounds of large image

I have a camera that I pan around a large image which works fine, however when I reach the end of the image I can keep panning on and on, forver. I have looked everywhere for an answer on how to ...
0
votes
0answers
148 views

Problems with First Person Camera in C++ OpenGL

I'm building a first person camera for my application but I'm having a couple of problems relating to moving the camera. In general, I have 2 vectors, one for the camera's position and one for the ...
0
votes
1answer
66 views

how to stop camera at the end of world map when zoomed in

Im building a tile-based game, and Im trying to implement zooming in on the center of the screen. My problem is, when I get to the edge of the map and im zoomed in, Im noticing that my camera doesn't ...
2
votes
2answers
196 views

How can I set up an intuitive perspective projection/view matrix combination in OpenGL, using GLM?

Could anyone help me set up an intuitive perspective camera matrix using OpenGL and the GLM library? By "intuitive" I mean that I want the camera to be looking at the middle of the screen down the -Z ...
0
votes
1answer
63 views

Relationship between Camera's view size, screen resolution and objects scale

I've had this question since a long time ago and wanted to know the relationship between how an object is viewed through the camera depending on the resolution of the device, the camera's view size ...
0
votes
0answers
96 views

Unity 2D Game: Camera following target and looping stage

I'm with a problem and I need some help, because I'm on early learning of gaming and Unity, and i want to learn doing it, so, i need all the help, you developers know how each little help, helps a ...
1
vote
1answer
80 views

Determine which face of a cube is facing the camera

I have a Cube with a unique color for each face. I made a script where I can swipe and rotate the Cube in increments of 90 degrees in each direction. what's the best way to determine which face of a ...
0
votes
1answer
83 views

Calculations for a camera system

I am building an interactive application in Starling for which a camera system is required. Since there is no existing camera system in flash and the addons for starling do not meet our requirements, ...