# Tagged Questions

52 views

### How to rotate vertices of 2D shape using a transform matrix?

I am making a top-down 2D game and am currently working on implementing improved collision using SAT. I programmed a Shape class with a Vector2 center that is its position in world space. On top of ...
27 views

### XNA - Link between Create Rotations matrices

A friend of mine have been coding some rotations on my XNA project, but the order of the matrices rotation are not good. Some are of form : Matrix.CreateRotationZ(1.21f) * ...
58 views

### How to use camera transformation without depending on (1,-1) scale during spriteBatch.draw()

I am creating a 2D platformer type game in XNA. I currently have a camera object, with a position/rotation/zoomlevel that I use to generate a transformation matrix to pass to SpriteBatch.Begin(). ...
45 views

So, we have implemented Krypton shadows into our code for our 2D game, and it's working beautifully. Only issue is that we're running into a bizarre graphical bug when rotating the shadows with the ...
159 views

### Rotation pitch/yaw reverse problems when picking a tile (2.5D) [closed]

Set-up: 3D world, isometric sprite rendering (4 fixed angles). This transform matrix is used as camera: _transform = Matrix.CreateRotationZ(Roll) * ...
106 views

### How can I properly rotate a 2D vector in the “flipped” XNA client space?

In my 2d XNA game, because SpriteBatch treats world space as client space and has positive Y axis down and negative up, I've built my game's world space with that coordinate system too. However, I've ...
146 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 ...
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, ...
127 views

### Keep Mini map static after rotating / zooming with camera

Hi I am making a 2D game, where the Camera is able to rotate / zoom in or out on the camera focus (the player usually). However my game also contains a mini-map, and so far whenever I have to rotate ...
848 views

### Camera for 2.5D Game

I'm hoping someone can explain this to me like I'm 5, because I've been struggling with this for hours and simply cannot understand what I'm doing wrong. I've written a Camera class for my 2.5D game. ...
102 views

### Screen space to world space revisited

I am revisiting some code that I thought I understood, but have found that I do not quite understand it. I put together a test to see what was going on. Here's the code: [Fact] public void wtf() { ...
102 views

### Minimal Projection Matrix

i hope you can help me. I'm currently stuck at the creation process for projection matrices used by shadow maps. The problem is the following: I got the spot/directional light ...
157 views

### Implementing axonometric bird-view in XNA

I made all kinds of logic (waypath, aso) for my strategical game, based on XNA (monogame). Now I "misused" the Vector2 a little bit: As I'm working from a "top-down" perspective, I'm using the Y-axis ...
293 views

### Creating a 2D perspective in 3D game

I'm new to XNA and 3D game development in general. I'm creating a puzzle game kind of similar to tetris, built with blocks. I decided to build the game in 3D since I can do some cool animations and ...
93 views

### Matrix transforms in XNA

So in my most recent 2D game I draw objects like so. _spriteBatch.Draw(_sprite, Center(), null, Color.White, _rotation, new Vector2(_sprite.Width / 2, _sprite.Height / 2), _scale, ...
396 views

### World space and model space the dummies version [closed]

I'm by no means a 3d programmer but have recently taken it upon myself to build a Voxel based game and I'm having a little trouble understanding some of the concepts around matrices (what with my ...
62 views

### Assigning bone transform in every draw a good idea?

In my Draw method, I am doing the following: thisMesh.CopyAbsoluteBoneTransformsTo(transforms); Is this a good idea? Or should I do this once at the constructor level?
321 views

### Stacking Drawing Matrix for SpriteBatch in XNA

I'm trying to make a 2D engine for XNA with SpriteBatch. My object unit is Entity, which can include other Entities as its children. However, when drawing them, the rotation and scaling stacking do ...
223 views

### How attach a model with another model on a specific bone?

I meet a difficulty attached to a model to another model on a "bone" accurate. I searched several forums but no result. I saw that many people have asked the same question but no real result see no ...
466 views

### How can I attach a model to the bone of another model?

I am trying to attach one animated model to one of the bones of another animated model in an XNA game. I've found a few questions/forum posts/articles online which explain how to attach a weapon ...
230 views

### Matrix.CreateBillboard centre rotation problem

I'm having an issue with Matrix.CreateBillboard and a textured Quad where the center axis seems to be positioned incorrectly to the quad object which is rotating around a center point: Using: ...
224 views

### Movement on the X an Z axis are combined?

This is probably a stupid question, but I'm trying to simply move a 3D object up, down, left, and right (Not forward or backward). The Y axis works fine, but when I increment the object's X position, ...
97 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 = ...
300 views

### Does XNA 4 support 3D affine transformations for 2D images?

Looooong story short I'm essentially trying to code Mode 7 in XNA. Before I continue bashing my brains out in research and various failed matrix math equations; I just want to make sure that XNA ...
219 views

### Getting and Setting Rotation in XNA around the Center of my Model with XNA

Alright, so I'm currently debating how I want to do this. Basically this is what I'm trying to accomplish. I've created a system to allow me to make my environment a little bit easier. I'm ...
282 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 ...
503 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 ...
448 views

### Vectors from matrix

In XNA you can get front/back/left/right vector of Matrix class. How get these vectors without XNA, through C++ using standart 4x4 matrix ? I dont understand what exactly they mean but found them very ...
296 views

### Retrieving model position after applying modeltransforms in XNA

For this method that the goingBeyond XNA tutorial provides, it would be really convenient if I could retrieve the new position of the model after I apply all the transforms to the mesh. I have edited ...
4k views

### Scaling Model in XNA, keep position

I am trying to create a little fun 3D game in XNA, but I am having some problems with scaling my models. I use models from random sites, so my battleship is for an example 10 times larger than my ...
2k views

### Moving a rotated model in XNA

This seems like a simple problem with an equally simple solution that is invisible to me. I have a model that spawns at the origin and looks at my player model wherever it goes. I would like it to ...
2k views

### Rotating a model AND translating it forward in XNA

I have this enemy class, and I want it to 1) Spawn at a certain place Vector3 pos 2) Rotate to face my player position 3) Move forward As this code is now, it will appear at it's specified place: ...
374 views

### How do I create weapon attachments?

My question is; I am developing a game for XNA and I am trying to create a weapon attachment for my player model. My player model loads the .md3 format and reads tags for attachment points. I am able ...
457 views

### Xna Equivalent of Viewport.Unproject in a draw call as a matrix transformation

I am making a 2D sidescroller and I would like to draw my sprite to world space instead of client space so I do not have to lock it to the center of the screen and when the camera stops the sprite ...
530 views

### Passing an objects rotation down through its children

In my topdown 2d game you have a player with a sword, like an old Zelda game. The sword is a seperate entity, and its collision box "rotates" around the player like an orbit, but always follows the ...
2k views

### Screen space to world space

I am writing a 2D game where my game world has x axis running left to right, y axis running top to bottom, and z axis out of the screen: Whilst my game world is top-down, the game is rendered on a ...
769 views

### Transformation order when dealing with Meshes

I have created a player model out of primitive types. To do this I have created a Model class and Component (mesh) class. Each model consists of one or more components my problems start when you have ...
326 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 ...
799 views

### What is the difference between Vector2.Transform and this method?

I've been working on some steering behaviors and ran into trouble with my logic for converting points in world space into points in local space. I had this (it's not optimized for multiple points yet, ...
340 views

### How do you extract a Vector3 positions only from a world matrix in an array of positions (from Kinect)

've just started building a physical camera class for the depth data you get from a Kinect. I have a Vector3 array of [imageWidth, imageHeight] describing the LOCAL positions I get in from the kinect ...
374 views

### Confused about order of operation when using a Matrix in XNA, C#

Here are two different pieces of code This is what I started with Vector2 hold = Vector2.Transform(pos1, mat1); Matrix inv = Matrix.Invert(mat2); Vector2 pos2 = Vector2.Transform(hold, inv); And ...
1k views

### How can I use a 3x3 matrix within a 4x4 matrix representation?

In XNA there is only one Matrix class which is actually 4x4 matrix. How to use it to represent a 3x3 matrix? I am trying to represent the inertia tensor of a body which is a 3x3 matrix, so I have ...
437 views

### Transformed Pretransformed coordinates?

I am creating a minecraft like terrain engine thing in XNA and C#, and I am trying to create a item/block selector tool. The thing is I would like to have 3D objects on the tool. So I thought for the ...
1k views

### How do I adjust the origin of rotation for a group of sprites?

I am currently grouping sprites together, then applying a rotation transformation on draw: private void UpdateMatrix(ref Vector2 origin, float radians) { Vector3 matrixorigin = new ...
741 views

### Why is my model's scale changing after rotating it?

I have just started a simple flight simulator and have implemented Roll and pitch. In the beginning, testing went very well; however, after about 15-20 seconds of constantly moving the thumbsticks in ...
1k views

### How should I calculate world and projection matrices in this scenario?

I'm trying to understand transformation matrices. Suppose I use the camera from this StackOverflow answer, this is how my view matrix would look: Matrix.Identity * ...
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 ...
867 views

### XNA 2D Transform Matrix Scale at Zoom Question

This is the complete code I am currently using for my camera. It is incomplete and only partially understood by me (I am working off an example), but I have managed to hack some functionality with ...