0
votes
2answers
89 views

Set new forward directions based on camera position

I have a 3rd person camera which can rotate around the player. When I look at the back of the player and press forward, player goes forward. Then I rotate 360 around the player and "forward ...
1
vote
1answer
67 views

How to make an object move again after being stopped by collision in Unity?

I have a player object which position is always centered on the main camera's viewport. This object has a Rigidbody 2D, a box and circle collider. The player moves around a level, the level has a ...
0
votes
1answer
46 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
158 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 ...
1
vote
2answers
177 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
0answers
40 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
129 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 ...
2
votes
1answer
68 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
1answer
507 views

How to clamp player movement correctly?

I have a 2D space shooter game. I looked up some questions from unity community and came across this solution. Below is the code for my player's movement: //horizontal <- || -horizontal -> ...
0
votes
1answer
270 views

XNA 2D Camera, zoom into player

My 2D camera follows the character fine without any zooming. However, when I tried adding a zoom feature using the Matrix.CreateScale(), the camera no longer follows the character properly. public ...
0
votes
0answers
38 views

Matrix transforms with SpriteBatch overloading - how do you rotate/zoom around a point? [duplicate]

I have a transform matrix which works as intended for game objects I want to be completely controlled by my camera: _transform = Matrix.Identity * Matrix.CreateTranslation(-_position.X, ...
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 ...
4
votes
2answers
1k views

Camera chasing player

I want the camera to follow the player and lag a little bit and then catch up with the player when the player halts. When stopped the player is in the center. At the moment im at the point where i ...
0
votes
1answer
174 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
260 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 ...
2
votes
2answers
242 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 ...
1
vote
2answers
317 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 ...
10
votes
2answers
3k 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 ...
0
votes
1answer
638 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 ...
2
votes
1answer
260 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 ...
-5
votes
1answer
150 views

camera2d class will not work [closed]

using System; using System.IO; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Content; using Microsoft.Xna.Framework.Graphics; using Microsoft.Xna.Framework.Input; using ...
12
votes
2answers
2k views

How to blend two cameras when traveling through a portal in Unity3D

Before I get to my question, I know the most obvious solution would be to use the normalized view port rect, however I need more complex shapes than a rectangle, and I've looked in to using the view ...
0
votes
3answers
752 views

How do I create a 3rd person camera?

I currently have a camera class set up and have my model/player loaded but I can't get my camera in the correct position by changing the x,y,z coordinates. I have set up my "game" with a separate ...
0
votes
1answer
100 views

A view and projection matrix oddity?

I have a bit of a dilemma ... So i setup my scene how I want it with some bits in it and now I want to move all my camera related code in to a camera class however doing so is proving to be a pain in ...
3
votes
1answer
305 views

Unity3D Camera constantly moving

I'm trying to make my own first person camera controls in unity that use both thumbsticks on a joypad. I have this working fine. However, when I move the right thumb stick (the one uses to look left / ...
0
votes
1answer
671 views

XNA - move camera over tilemap

I am trying to build a game based on Advance Wars in XNA. I am so far where the tiles are placed on the screen, except here starts my problem. During the game, I ofcourse want to move the camera ...
4
votes
1answer
138 views

Why does CameraZ=0 result in no render?

I am trying to draw simple model, but I am experiencing strange error. When I use this View matrix: Matrix.CreateLookAt(new Vector3(0, 200, 1), new Vector3(0, 0, 0), Vector3.Up); my model is drawn ...
2
votes
1answer
393 views

C# 2D Camera Max Zoom

I have a simple ship sprite moving around the screen along with a 2D Camera. I have zooming in and out working, however when I zoom out it goes past the world bounds and has the cornflower blue ...
0
votes
0answers
145 views

Keep 3d model facing the camera at all angles [duplicate]

I'm trying to keep a 3d plane facing the camera at all angles but while i have some success with this: Vector3 gunToCam = cam.cameraPosition - getWorld.Translation; Vector3 beamRight = ...
7
votes
2answers
603 views

Rotate a vector

I want my first-person camera to smoothly change its viewing direction from direction d1 to direction d2. The latter direction is indicated by a target position t2. So far I have implemented a ...
2
votes
1answer
100 views

Camera closes in on the fixed point

I've been trying to create a camera that is controlled by the mouse and rotates around a fixed point (read (0, 0, 0)), both vertical and horizontal. This is what I've come up with: camera.Eye = ...
0
votes
1answer
123 views

Connect camera class to game

I've been following a tutorial on making a free camera for a 3D model. What the camera class does is allow the player to move and rotate in respects to the model's current position using the right ...
0
votes
1answer
492 views

Why does my 3D model not translate the way I expect? [closed]

In my first image, my model displays correctly: But when I move the model's position along the Z-axis (forward) I get this, yet the Y-axis doesnt change. An if I keep going, the model disappears ...
0
votes
1answer
299 views

3d world vertex translation to go to 2d screen coords

My technical english is a little rusty so to avoid misunderstands please be patient with me :) I will try to be brief and clear Situation: - I have a 2d sprite character on the screen - I've just ...
1
vote
1answer
460 views

xna orbit camera troubles

I have a Model named cube to which I load in LoadContent(): cube = Content.Load<Model>("untitled");. In the Draw Method I call DrawModel: private void DrawModel(Model m, Matrix world) ...
2
votes
1answer
531 views

Why use 3d matrix and camera in 2D world for 2d geometric figures?

I'm working in XNA on a 2d isometric world/game and I'm using DrawUserPrimitives to draw some geometric figures... I saw some tutorials about creating dynamic shadows but I didn't understood why they ...
5
votes
2answers
3k views

Keeping the camera from going through walls in a first person game in Unity?

I'm using a modified version of the standard Unity First Person Controller. At the moment when I stand near walls, the camera clips through and lets me see through the wall. I know about camera ...
4
votes
1answer
863 views

2D Camera Acceleration/Lag

I have a nice camera set up for my 2D xna game. Im wondering how I should make the camera have 'acceleration' or 'lag' so it smoothly follows the player, instead of 'exactly' like mine does now. Im ...
0
votes
4answers
3k views

XNA spritebatch drawing to the centre of screen

I have bit of a silly problem. Is is possible to use SpriteBatch.Draw() method to draw to the centre of screen using coords from the beginning of window (So resolution 800x600 would use 400;300) ...
3
votes
1answer
2k views

Orbiting a specific point - Orbiting Camera

How would I create a camera that with the mouse, it allows you to orbit around a specifc position, with the camera always facing that point? I would also like it to be able to always be at a constant ...
1
vote
3answers
2k views

3D XNA Tracking Camera

I'm trying to implement a camera that tracks a 3D model in my game. I've taken a look at this MSDN article on creating a 3rd person camera, as well as experimenting on my own; but I don't get the ...
1
vote
1answer
332 views

How to prevent 2D camera rotation if it would violate the bounds of the camera?

I'm working on a Camera class and I have a rectangle field named Bounds that determines the bounds of the camera. I have it working for zooming and moving the camera so that the camera cannot exit its ...
3
votes
1answer
323 views

Should the camera's rotation value be clamped?

I noticed that when writing a camera for my 2D game that the camera rotational value of -6 and 6 is equivalent to 0. That is, -6 = -12 = -18 = -24 = 6 = 12 = 18 = 24. I was wondering if it was ...
2
votes
1answer
305 views

delay camera xna

I read this tutorial http://www.riemers.net/eng/Tutorials/XNA/Csharp/Series2/Camera_delay.php but i didnot unsterstand it. Is there another way to delay the camera position movement without this ...
0
votes
1answer
226 views

How to move the camera in XNA only after few moments?

I made the camera position 10 units from an object, but not behind it. I dont want the camera position behind the object right away when it rotates, I want that when I will rotate the object, the ...
4
votes
1answer
343 views

Getting the Bounds of a 2D Cameras View with Zoom

I am using a 2D camera, which does rotations and zoom. Currently, I am using the following to get my MinX, MinY, MaxX and MaxY... public float MinX { get { return ...
13
votes
3answers
5k views

How do I implement a quaternion based camera?

UPDATE The error here was a pretty simple one. I have missed a radian to degrees conversion. No need to read the whole thing if you have some other problem. I looked at several tutorials about this ...
-2
votes
2answers
410 views

Move camera on X and Z only

How would you implement movement on a camera in order to always move it on X and Z coordinates, and if the camera has pitch yaw or roll it still moves only in those coordinates and doesn't fly up?
5
votes
3answers
2k views

XNA 4.0: 2D Camera Y and X are going in wrong direction

I asked this question on stackoverflow but assumed this might be a better area to ask it as well for a more informed answer. My problem is that I am trying to create a camera class and have it so ...
7
votes
1answer
853 views

Scrolling a WriteableBitmap

I need to simulate my background scrolling but I want to avoid moving my actual image control. Instead, I'd like to use a WriteableBitmap and use a blitting method. What would be the way to simulate ...