# Tagged Questions

60 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 ...
88 views

### How can I read the color of a specific pixel in XNA?

I want a way to find out if, for example, the pixel at Vector2(2, 5) on the game window is color Color.Red, or some other color or set of coordinates. How can I do this?
78 views

### How to encode float3 into float2 and back again in HLSL?

Good afternoon, I am looking to offload some 3D calculations to the GPU without raising my requirements to DX10. Specifically, I am generating densities in 64x64x64 3D blocks, which fit nicely into ...
216 views

### What am I missing? (Converting 2D mouse coords to 3D space)

I'm making a networked game which has a birds-eye view and I'm trying to convert the 2D mouse coordinates into 3D space. Right now I have a perfectly flat grid and it intends to remain perfectly flat, ...
234 views

### Game Editor - When screen is clicked, how do you identify what coordinate you clicked?

This is a follow-up to my earlier question: Game Editor - When screen is clicked, how do you identify which object that is clicked? Something I've noticed is that picking only calculates a ray and ...
90 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 ...
3k views

### Converting world space coordinate to screen space coordinate and getting incorrect range of values

I'm attempting to convert from world space coordinates to screen space coordinates. I have the following code to transform my object position Vector3 screenSpacePoint = ...
723 views

### XNA texture stretching at extreme coordinates

I was toying around with infinitely scrolling 2D textures using the XNA framework and came across a rather strange observation. Using the basic draw code: spriteBatch.Begin(SpriteSortMode.Deferred, ...
161 views

### Find a Rectangle by coordinates - XNA

I have 2 coordinates (X,Y). I have also a 10x10 array. By these coordinates I have to find the rectangle in which is my pointer at the moment. How could I handle it?
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) ...
368 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 ...
446 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 ...
678 views

### Confusion with the texture coordinate system in XNA

I am creating a cow out of primitive shapes, and am using the minecraft cow texture as a placeholder. To create the primitive model I have created a 'model' class and created a sub class 'ModelCow' ...
1k views

### Generating spherical world from heightmapped terrain

I am using a standard heightmapped procedural terrain in my project. However, I want the terrain to appear spherical when the user zooms out. This is an attempt to simulate the appearance of a ...
1k views

### Obtaining a world point from a screen point with an orthographic projection

I assumed this was a straightforward problem but it has been plaguing me for days. I am creating a 2D game with an orthographic camera. I am using a 3D camera rather than just hacking it because I ...
4k views

### Why / how does XNA's right-handed coordinate system effect anything if you can specify near/far Z values?

I am told repeatedly that XNA Game Studio uses a right-handed coordinate system, and I understand the difference between a right-handed and left-handed coordinate system. But given that you can use a ...