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
0answers
3 views

Destroying Unity GameObject when it goes out of camera during runtime

I have this GameObject instanciated in unity - void Start () { GameObject myRoadInstance = Instantiate(Resources.Load("car"), new Vector3(5, 5, 5), ...
0
votes
0answers
25 views

Particle system ONGui()

I have some scripts which uses OnGUI() method and they are attached to my GameMenu object. I need to play a particle system on the scene while the GUI scripts are active. When I do that I cant see the ...
0
votes
1answer
19 views

Check if is object in camera field and not covered by other object

I know how to check if object is in camera view but how I can check if that object is cover by something elese? In my case I want to turn on or off some effect when I look at light. At this moment my ...
0
votes
0answers
33 views

Adding some recoil to the Camera

I just want to add some recoil to the camera, but I can't find a working script. It's an fps, so I take my mouse axis to rotate the camera. And now I want a pushback to the top, so that the camera ...
-1
votes
1answer
25 views

move a spaceship player inside an Orthographic camera, unity [on hold]

I'm creating a 3d shmup in an Orthographic camera, and I want to move the ship inside the camera, instead of move all the environment. The problem is that i can center the ship in the camera when the ...
0
votes
2answers
31 views

Stop Lerp at relative location?

In my Unity 2D platformer, I'm trying to move the camera down a bit when the character is crouching but not moving. I've done this with the following: cameraPosition = ...
4
votes
1answer
94 views

What direction is forward when the rotation is (0, 0, 0)?

I'm representing the rotations of my actors (or gameobjects) with euler angles (one float for each axis). And I've always considered the vector (1,0,0) (x,y,z) to be the actor's direction if all ...
1
vote
0answers
28 views

Different Screen Sizes and Camera in Unity

Now I know that no matter what the screen size is the camera will keep its height, so no worries about that. My question is, is there a way to manipulate the camera, either its orthographic size, or ...
0
votes
1answer
53 views

Rotate Camera around GameObject in Unity [on hold]

Using Unity 5's new touch system, how can I rotate the camera around an object using touch detection, or "swipes"? I can do this using earlier versions of Unity, however the more recent version, Unity ...
1
vote
0answers
32 views

Rotating a 3rd person camera toward a target

I have a 3rd person camera that doesn't look directly at the player but somewhere in front of him. When the user enter shooting mode, I want the camera to turn around the player to face the target. ...
1
vote
1answer
31 views

OrthographicCamera and viewport not giving expected effect

I recently asked a question about this area that I think was too broad, so I will try a new approach. I have the following code I am experimenting with: batch = new SpriteBatch(); ...
0
votes
1answer
73 views

The camera in a 2D tile based side scroller is moving slower than the player [on hold]

In my 2D tile based side scroller, I want a camera that scrolls in the x direction, but not in the y direction. The world is separated into three zones; one on the left and one on the right where the ...
1
vote
1answer
72 views

How To calculate camera boundaries

Is it possible to calculate the exact camera bounds? By this I mean the white lines that represent the camera area e.g the lines in the picture: I'm using Camera.main.screenToWolrdCoordinates to ...
0
votes
0answers
18 views

How to get camera to follow player, but stop when reaching end of screen? [duplicate]

I'm making a 2D game in Unity and I'm having issues with the camera. I need the camera to stay within the boundaries of the level (the background sprite), but then follow the player around the level. ...
3
votes
1answer
147 views

determining view boundaries based on z position when using a perspective projection

I'm using three.js to make an animation of a box moving around the screen in 3 dimensions. It is moving pseudo-randomly, according to a noise function. So, I want to place an invisible wall just ...
0
votes
0answers
30 views

Images not scaling properly in LibGDX when using “batch.setProjectionMatrix(camera.combined);”

I am trying to put Assets into my game but when i put in the line of code "batch.setProjectionMatrix(camera.combined);", which from my knowledge scales the Asset to the size of the window it appears ...
4
votes
2answers
300 views

How can I achieve a pseudo-3D camera effect like this?

I am trying to achieve a pseudo-3D camera effect similar to this: I have gotten the following results using a 3D camera and billboards: I am now running into the following problems: In the ...
0
votes
1answer
51 views

WebGL (three.js) - rendering object behind camera far plane

I need to have one object that is always visible/rendered (a lens flare, to be exact). I don't want to set the camera far plane to the maximum possible distance between camera and the sun (performance ...
0
votes
0answers
33 views

Matching the 3ds max camera view in my game 1:1

I want to match 1:1 the 3ds max camera render with my 3d engine (DirectX 11, C++). I believe that my mesh exporter (coded with MaxScript) works fine, I see the right shapes. But something about the ...
1
vote
1answer
162 views

Camera is centered on character, but doesn't show character in game window

I'm using Unity 4.6.3. I create an animation from sprite. When I press Play button, I see animation plays on scene window, but on Game Window, I don't see anything. Here is Inspector for main ...
0
votes
0answers
32 views

Motion Blur (as per GPU gems article) only considers camera rotation, not translation

I am following this article and have implemented it exactly as described: http://http.developer.nvidia.com/GPUGems3/gpugems3_ch27.html The problem is that things are only blurred when the camera is ...
0
votes
1answer
40 views

First Person Camera Target

I have a camera at position P, and a normalized direction vector D (where the camera is facing). I want the target of the camera to be 5 units forward from the position. Here's my attempt: F = (0, 0, ...
1
vote
2answers
127 views

Camera.WorldToScreenPoint not working with perspective

transform.position = Camera.main.WorldToScreenPoint( new Vector3( origin.position.x, origin.position.y, origin.position.z ) ); I have this code on a Unity 4.6 UI object. The origin is some transform ...
0
votes
1answer
66 views

Camera movement constrained to pixel boundaries

So a friend and me, we are currently making a game in C# using XNA. We are trying to get the camera to move in full pixel motion, but we just don't get it right. This concept is hard to explain, but ...
0
votes
1answer
75 views

2D game with angled top-down camera perspective [closed]

I want to create a game similar to binding of isaac, a slightly angled top-down 2D game. In binding of isaac, the character moves and shoots along a 4-way path, so when he is shooting towards East, ...
0
votes
1answer
41 views

Aligning Camera to Rectangle

I'm working on a game in Java, and I'm having some trouble with finding the correct camera position. I've already made a Rectangle that shows exactly where I want the camera to be, and at what scale: ...
0
votes
1answer
49 views

Fixed background on a SurfaceView

I'm currently working on a top-down twin-stick shooter for Android. I've got my player moving around and shooting, but I'm looking to add a large Bitmap background which is larger than the device ...
0
votes
3answers
67 views

Backround turning, follow the character

In my Unity2d-platformer, I need background to follow the character, so I just attach it. And when character turn left from right (or right-to-left), background turn too. How can I make my ...
0
votes
1answer
58 views

libgdx - Box2d debug draw not correct

I have a problem where the bodies in my debug draw does not draw correctly, take a look: As you can see, there is some space between the dynamic body and the ground. I have checked the contact ...
0
votes
1answer
28 views

How to compute the forward facing direction from three angles and then translate along it?

Given: float yaw, pitch, roll; How does one compute the forward direction: vec3 forward = computeForwardFromEulers(yaw, pitch, roll); Next, I would like to use this information to translate an ...
0
votes
1answer
82 views

Distortion problem with perspective projection

For various reasons – partly educational, partly technical – I'm writing a 3D game engine from scratch, using OpenGL 3.0; aiming for Core Profile, eventually, so of course I'm using a custom matrix ...
0
votes
2answers
51 views

how to fix the character flip when using orthographic camer libgdx

i used orthographic camera to follow the character(player) but the problem that is my character is flipped there is no tutorials on how to fix this please help as fast as possible here is my create ...
0
votes
1answer
87 views

Rotate camera keeping player not in the middle

Here I have a 2D top down game. Currently the camera is set on the player position. The player constantly points to mouse position. I want to modify this setup having the camera to be set slightly ...
0
votes
1answer
56 views

Sprites and Box2d

I'm starting to see how box2d works now, except I dont know how to scale the screen to diffrent screen sizes and how i can convert Sprite sizes to box2d units. I know box2d uses meters and such, but ...
0
votes
1answer
104 views

Camera Movement Smoothing

I am trying to smooth a camera I create in my game, but I can't seem to find a way to actually do this correctly. What I have : //Calculate the "current" Forward vector var cameraForward = ...
0
votes
0answers
27 views

Display problems with iPhone4s and Unity

I'm having an issue with the screen on iPhone4s. I calibrated the camera's viewport size depending on the screen resolution. This has given me buggy results on the 4s since ther e is a black stripe of ...
0
votes
0answers
27 views

Does the on-screen size of object change with the direction of camera?

I'm reading the following document, and on page 3 it says: The first thing to notice is that the desired projection on the screen does not change with view direction. That is, whether the screen is ...
0
votes
0answers
171 views

OpenGL - Arcball camera rotation

I'm implementing arcball camera rotation, whereby a camera is looking at a coordinate and rotates around it in the x-axis or the y-axis such that the camera is circulating around it; the y-axis will ...
0
votes
0answers
55 views

GameObject is only rendered when it has a negative z scale

I have an orthographic camera that looks like this: I create 2d polygonal meshes that have uniform z values in their vertices. I use Camera.ViewportToWorldPoint() to map these viewpoint vertices to ...
0
votes
1answer
63 views

Mouse position to grid position not working

I have a function which converts my mouse position to grid position in the game but it is not working properly... its slightly off. I have two functions - one which converts from grid to screen ...
2
votes
1answer
137 views

LibGDX camera position shifted on movement

I'm programming a game with LibGDX and Box2D and I want my camera to follow my player. But as I zoom in (because Box2Ds metric system, using camera.zoom = x) the camera is shifted when the player ...
0
votes
1answer
79 views

Is using camera and viewport in Libgdx always necessary?

I understand that camera and viewport are important to keep virtual measurement units and handle different aspect ratios and resolutions when building games with worlds bigger than the screen (e.g. ...
0
votes
0answers
11 views

How to set up lights in Libqglviewer?

I decided to use Libqglviewer and the simple camera example to have a basic camera setup and play with fragment shading. I have not much experience in OpenGL but I have made my way through it. I have ...
0
votes
0answers
330 views

Implement Camera (former: CCCamera) v2 in cocos2d-x v3.3

we want to port camera code from cocos2d-x version 2 to version 3.3 with the goal to imitate the behaviour of a CCCamera in cocos2d-x version 2 exactly. You can assume that values for "eye" and "up" ...
2
votes
1answer
271 views

How to output to the Oculus and a 2D screen?

We'd like to present an Oculus game to a large group of people. Not everyone will have an Oculus headset, so we'd like to output to both the Oculus and a second display. The problem is that the ...
0
votes
1answer
48 views

Problematic cameraposition (Eye = (0,0,0), at=(0,-2,0) and up = (0,1,0))?

I am taking a course in computergraphics and we talk a lot about OpenGL and the math you need to do everything OpenGL does "by hand". A Question which was asked in an old exam (I am preparing at the ...
6
votes
4answers
257 views

Keeping sprites nice and pixelated

How do I keep the sprites in my game nicely pixelated on screens of all sizes and resolutions? I use nearest-neighbor texture filtering when resizing pixels, but this works well only at really high ...
1
vote
0answers
79 views

Why is my diffuse lighting changing with camera position?

I am trying to do lighting in view space, but I am afraid I have an issue. I calculate the normals as: N = norm_mat * vec4(vert_norm,0.0) where norm_mat is the transpose(inverse(model_view_mat)). ...
0
votes
1answer
124 views

How to move 2D camera in OpenGL

I am new in OpenGL, I am making a game in 2D and I want the camera to follow the character. I started with gluLookAt() but I read that I could just move the matrix with glTranslatef() and It should ...
1
vote
1answer
118 views

How can I implement a camera like the one in RotMG?

RotMG, an MMO top-down shooter, takes on a unique 2d-3d style, and has an intriguing camera; The game is obviously 3d, not simply isometric, and if you play the game and turn on camera rotation you ...