Tagged Questions
0
votes
1answer
39 views
3D drawing precision problem. XNA
I have a simple scrolling camera positioned 2000 units about the 3D 'floor' that moves forward by 1 unit every frame and looks down on the floor at a point that also moves forward by 1 unit every ...
0
votes
0answers
31 views
Best way to fit an camera inside a cube [closed]
I've been trying for a few days to create a perspective Camera that will always be axis aligned, can zoom in and out, and will scroll left and right, but should never extend past the bounds of the ...
0
votes
0answers
54 views
Top down 2D camera in relation to keyboard commands
I have a basic 2D camera:
transform =
Matrix.CreateTranslation(-position.X, -position.Y, 0) *
Matrix.CreateRotationZ(-rotation) *
Matrix.CreateScale(new Vector3(zoom, zoom, 1)) *
...
1
vote
1answer
80 views
Optimize maximum performance “Frustum.contain ()” on XNA?
I wonder if it is possible to optimize the performance of "BoundingFrustum" requesting return of the visible elements that are found only on the part of the ground before the player .. Checker and not ...
0
votes
1answer
58 views
Putting a 2d camera into a gamestatemanagement sample [closed]
Hello everyone i am new to xna and i am trying to implement a simple 2d camera that follows my sprite around the level i am using a gamestatemanagement so i have the basic platformer with screen ...
-5
votes
1answer
95 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 ...
0
votes
3answers
256 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
60 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 ...
1
vote
1answer
266 views
XNA - moving the 3rd person camera
I'm having following problem:
Can't set my camera to follow object from behind and rotate when I use left/right arrow. I've tried different tutorial and examples but it still doesn't work for me. ...
0
votes
1answer
316 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 ...
0
votes
0answers
95 views
Camera Projection back Into 3D world, offset error
I'm using XNA to simulate a robot in a 3D world and then do image analysis on what the camera sees.
I have my camera looking down in front of the direction that the robot is going, and I have the ...
0
votes
2answers
331 views
Making a Camera look at a target Vector
I have a camera that works as long as its stationary. Now I'm trying to create a child class of that camera class that will look at its target.
The new addition to the class is a method called ...
1
vote
1answer
74 views
XNA 3D coordinates seem off
I'm going through a book, and the example it gave me seems like is should work, but when I try and implement it, it falls short.
My Camera class takes three vectors in to generate View and Projection ...
0
votes
0answers
122 views
Keep 3d model facing the camera at all angles
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 = ...
1
vote
0answers
173 views
Camera not staying behind model while moving in circle
I have a camera behind a model (3rd Person) and I'm having problems KEEPING it behind the model. When I first start my game, you see the back of the model. If the model moves forward, backward or ...
0
votes
1answer
162 views
Limit the amount a camera can pitch
I'm having problems trying to limit the range my camera can pitch. Currently my camera can pitch around a model without restriction, but having a hard time trying to find the value of the ...
1
vote
1answer
123 views
Camera wont stay behind model after pitch, then rotation
I have a camera position behind a model. Currently, if I push the left thumbstick making my model move forward, backward, or strafe, the camera stays with the model. If I push the right thumbstick ...
7
votes
2answers
417 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 ...
4
votes
1answer
243 views
How do I calculate the boundary of the game window after transforming the view?
My Camera class handles zoom, rotation, and of course panning. It's invoked through SpriteBatch.Begin, like so many other XNA 2D camera classes. It calculates the view Matrix like so:
public Matrix ...
2
votes
1answer
91 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
47 views
Camera changes view when controller connected
I have a weird situation. I have a model set to 0 for X,Y and Z. My camera's position is set to:
0 (X-value, but updates when the model moves around)
the model's height + 20f (about the same level ...
1
vote
1answer
386 views
Pitch camera around model
Currently, my camera rotates with my model's Y-Axis (yaw) perfectly. What I'm having trouble with is rotating the X-Axis (pitch) along with it. I've tried the same method for cameraYaw() in the form ...
0
votes
1answer
111 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
324 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
238 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 ...
0
votes
2answers
173 views
Determining my playable area/field of view
Contrary to what I found searching for the answer, I'm not trying to see whether a character is in view of another character. What I need to find out is the size of the field of view. This is because ...
2
votes
1answer
431 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 ...
1
vote
0answers
690 views
Orthographic Camera Zooming
In XNA I am using a spritebatch to render a board. I have created a camera class which can provide me a view and projection matrix. Currently I am supplying the view matrix to my sprite batch when I ...
2
votes
1answer
620 views
Light mask map and camera for static lights in XNA Platformer
Using the example for some basic light maps found here : http://blog.josack.com/2011/07/xna-2d-dynamic-lighting.html, I've managed to create a lightmap texture using individual lightmaps and display ...
0
votes
1answer
216 views
World Location issues with camera and particle
I have a bit of a strange question, I am adapting the existing code base including the tile engine as per the book: XNA 4.0 Game Development by example by Kurt Jaegers, particularly the aspect that I ...
2
votes
1answer
551 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
2k 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) ...
1
vote
1answer
945 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
293 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 ...
2
votes
1answer
253 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
230 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
214 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
613 views
How can I achieve a zoom-like camera effect?
I have a top down 3D camera:
view = Matrix.CreateLookAt(new Vector3(0,0,20), Vector3.Zero, Vector3.Up);
Now I want to achieve the effect like when I zoom in the scene and only show a section at the ...
1
vote
2answers
363 views
Creating a rotation offset based on camera position with XNA
I have an XNA project where characters have the ability to pick up and move objects around (in 3d). When an object is picked up by a character, I want ithe objects position to always be out in front ...
5
votes
1answer
518 views
How can I implement view wobble when my player is running?
I'm creating a FPS in XNA. So far its' going great. What I'm looking at doing is replicating the camera movements that you see in Modern Warfare. So, if you are walking the camera stays pretty ...
0
votes
1answer
488 views
XNA 3rd Person Camera - pitch reverses when facing backwards?
I have a 3rd person camera which rotates around the Y axis fine (yaw) and when I am facing forward (0, 0, -1) moving the mouse up moves the camera up and down great. But the more I turn the player and ...
-2
votes
2answers
352 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
1k 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 ...
1
vote
1answer
741 views
moving 2D camera
I've got a camera that places the character about a 1/4 way into the screen. The problem I'm having is that when the character moves left the character stays in place now placing the character 3/4 the ...
3
votes
1answer
2k views
Mouse location is off due to camera
I'm building a top down shooter but I have a little issue with my camera and mouse.
When I add the camera that I use to my game (see here) my mouse pointer seems to be in the wrong location.
When I ...
2
votes
1answer
460 views
Positions are “off” after adding a camera transformation (2d)
Game source code: https://github.com/dnguyen/Aurora
I am using this to create a 2D camera: http://www.david-amador.com/2009/10/xna-camera-2d-with-zoom-and-rotation/. After I added the transformation ...
4
votes
4answers
928 views
From camera coordinates to world coordinates
I want to calculate world coordinates from camera coordinates. However, I seem to have problems with my understandings of how matrices in HLSL work.
From world to camera is clear:
cameraPosition = ...
3
votes
3answers
752 views
2D XNA game Camera issue
I'm currently making a 2D Worm-clone in XNA, and have regrets about the way I've made my camera. I declare my camera in my Main class and the camera follows the player. In my draw I then begin my ...
3
votes
2answers
2k views
Help me get my 3D camera to look like the ones in RTS
I am a newbie in 3D game development and I am trying to make a real-time strategy game. I am struggling with the camera currently as I am unable to make it look like they do in RTS games.
Here is my ...