# Tagged Questions

Numeric representation of the location of an entity in the game space. There are multiple forms of coordinate systems to cater to a variety of methods to map position.

7k views

### Why is the origin in computer graphics coordinates at the top left?

From what I've seen almost all things use coordinates where (0, 0) is at the top left and the positive Y-axis goes in the downwards direction of your screen. Why is it like this? Why not the ...
7k views

### How to deal with differences between 2D screen coordinates and Cartesian coordinates

Most 2D screen/bitmap coordinate systems have the positive Y axis pointing down (with the the origin in the upper left corner). This is counter to how most people think geometrically with the positive ...
1k views

### What's so different/complicated/useful about vectors?

Forgive me if this isn't considered a real question, but it is something I am genuinely confused about. I constantly hear other game developers talk about how using vectors are very useful, but also ...
5k views

### Why is Y up in many Games?

I learned at school that the z-axis is up. It is the same in modeling software like Blender. However in many games the y-axis is up. What is reason?
589 views

### Orthographic unit translation mismatch on grid (e.g. 64 pixels translates incorrectly)

I am looking for some insight into a small problem with unit translations on a grid. Update and Solved I solved my own issue. See below for details. Everything in this part of the post turned out to ...
5k views

### Staggered Isometric Map: Calculate map coordinates for point on screen

I know there are already a lot of resources about this, but I haven't found one that matches my coordinate system and I'm having massive trouble adjusting any of those solutions to my needs. What I ...
470 views

### World Bounds - (0, Size) or (-HalfSize, HalfSize)?

When creating a game space in which to move, draw and collide objects, is it better to have the (0,0) point, or the (0,0,0) point, be in the very center of your space, such that the bounds of the ...
803 views

### Half-Life 2 BSP Lightmaps

I'm writing a BSP viewer for a university project. So far I have the main geometry loaded properly, and the PVS working. Now I'm trying to apply the lightmaps, but I can't seem to get the texture ...
2k views

### How do I translate a spherical coordinate to a Cartesian one?

Could someone point me in the right direction as to how this might be achieved? 3D math / geometry often throws me. I'm looking for something like this (ideally in C#): public Vector3 ...
5k views

### 2D isometric: screen to tile coordinates

I'm writing an isometric 2D game and I'm having difficulty figuring precisely on which tile the cursor is. Here's a drawing: where xs and ys are screen coordinates (pixels), xt and yt are tile ...
7k views

### How do I convert between two different 2D coordinate systems?

I'm trying to convert a coordinate from one coordinate system to another, so that I can draw it on an image. Basically the destination coordinate system is as follows: X range: 0 to 1066 Y range: 0 ...
301 views

### BRDF and Spherical coordinate in ray tracing

I developed a ray tracer that use standard phong/blinn phong lighting model. Now I'm modifying it to support physically based rendering, so I'm implementing various BRDF models. At the moment I'm ...
7k views

### How do I convert from the global coordinate space to a local space?

Given an entity named EntityA, I want to define a local coordinate space, where the position of EntityA is the origin, its heading vector is the X axis, and the normal of the heading vector is the Y ...
180 views

### Get local coords from global coords

I need to get local coords from global coords. I did not find ready-made examples. Please help me how to do it on the example image. Thank you! UPDATED: Here's the method in the java, created ...
5k 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 ...
537 views

### Overcoming float limitations for planet-sized worlds in Unity

As far as I know, going further than 1M units from the world origin in Unity is hardly possible due to floating point precision issues. Making a world more than 1M units in radius would require ...
12k views

### Blender - exporting .obj with texture coords

I'm writing a game which uses obj files. I created an object in blender and I applied texture without UV coordinates and my question is: how to export this object to obj file, but with texture ...
5k views

### Left-Hand and Right-Hand Coordinate Systems

In Blender and other 3D modeling tools, the coordinate system is right-handed, while in Unity 3D and Orbiter Space Flight Simulator, they are left-handed, why this could happen? Why they don't simply ...
7k views

### Changing coordinate system from Z-up to Y-up

Blender's coordinate system is different from what I'm used to, in that Z points upwards instead of Y. What would be the simplest way of converting all the world data (so that all animations, texture ...
6k views

### Why is my sprite displayed offset from its Box2D body?

I found out about this using a debug renderer. When the game starts, everything is in order. But when a collision happens, the sprite's rotation is way larger than its body. The sprite and body match ...
8k views

### Get points on a line between two points

I'm making a simple space game in JavaScript, but now I've hit a wall regarding vectors. The game view is top-down on a 2d grid. When the user clicks on the grid, the space ship will fly to that ...
308 views

### detecting the coordinates where a bullet hits a mesh

I have a lot of complex objects in a scene and I'm looking for an efficient way to find which object a fired bullet hits, and to find the hit coordinates. It would be best if there was a lightweight ...
771 views

### Is a custom coordinate system possible in Unity

Is it possible to create a custom coordinate system (i.e the one using double for coordinates or the one dividing the world into 'chunks' of safe size) not constrained by the floating point precision ...
160 views

### How can I represent location in a massive world?

I've been thinking about No Man's Sky a lot recently and all the technical challenges they must face. For example, how on earth do you store a players location in a world that is so enormous? I ...
1k views

### Spherical to Cartesian Coordinates

Well I'm reading the Frank's Luna DirectX10 book and, while I'm trying to understand the first demo, I found something that's not very clear at least for me. In the updateScene method, when I press A, ...
602 views

### Tile coordinates

Simple question I have here. Say my tile map is based on 32x32 tiles for an 800x600 image so let's say 25 tiles across and 19 down. So now I have that cell 0 of any row contains the first 0-31 ...
508 views

### Calculate the Z of a line intersection given the XY coordinates?

I'm intersecting a line in 2D and I calculate the X,Y coordinates of the intersection point. What I need is the Z of the intersection point given the X,Y,Z of the line points, and the X,Y of the ...
1k views

### How does a wow server handle which player position to set to each nearest players?

I already understood how game developers could create very large game levels, bypassing the floating point precision limit. This was my very first mind boggling question, and I understood it when I ...
1k views

### Coordinates from 3DS Max to XNA 3.5

My problem is this. I have a simple box made in 3DS Max 2009, the Box is 10x10x10. I've tried to load it on XNA and traslate the camera for 15 units, but I can seem to find the values needed to see ...
644 views

### Isometric Screen View to World View

I am having trouble working out the math to transform the screen coordinates to the Grid coordinates. The code below is how far I have got but it is totally wrong any help or resources to fix this ...
365 views

### How to flip coordinate system in Pyglet?

Is there any way I can flip the coordinate system in Pyglet vertically so that y = 0 is at the top of the screen and a higher y value is closer to the bottom? It is really confusing trying to use ...
4k views

### Mapping 3D object coordinates to 2D screen coordinates with perspective projection

Sort of following on from where this person was in their topic: Matrix for 2D perspective What I have at the moment is a transformation matrix that's defined as follows: http://pastebin.com/GM6BhP0R -...
1k views

### Draw a 3D object at specific coordinates on the screen

I'm creating an application which allows the user to manipulate 3D models. I would like to draw 3 axis representing the world coordinate system in 3D in order to give the user an idea where he is. ...
654 views

### Is there any algorithm for creating 3D lightning?

Is there any algorithm for generating lightning? Lets say, you input the starting and ending coordinates (x,y,z) and out comes an array of coordinates to show where the lightning goes. It doesn't have ...
1k views

### How do I convert screen coordinates to isometric tile map coordinates in libGDX using matrices

I know this has been asked many times but my question doesn't quite fit the others. I have an IsometricTiledMap and I need to get the tile under a set of screen X and Y coordinates. Here is a picture ...
1k views

### Isometric to screen, screen to isometric for irregular projection

I have isometric assets that unfortunately can't change and need to work out the projection for those. Here is how a tile looks like: The tile image width/height ratio is 0.(6) (height/widht = 1.5)....
2k views

### Get world coordinate under mouse (at a ground plane for Warcraft 3 like movement)

I want to let a unit follow the mouse like in any RTS (Warcraft 3, Starcraft, ...). For that I have a "ground plane" which is defined through 2 vectors, the X and Z axis. Now I need to get the world ...
257 views

### Can you help me solve the paradox that has confused me about the glViewport and glOrtho functions?

suppose that I have an image that I want to apply as a texture on a geometry (at time we don't consider texture mapping but this image has a certain width and height here it is a 512x512 image) I want ...
6k views

### OpenGL ES and Screen Coordinates

Is there anyway I can make OpenGL ES 2.0 to accept coordinates (for Vextex for example) in int meaning the pixels instead of the default float system? Also how can I set the point (0,0) to be at the ...
690 views

### Convert point to its barymetric coordinates

I'm making a 2.5D game engine (in JavaScript) and I'm trying to get it to detect whether a block is under the cursor. This would be a simple task were it restricted to single-level isometric ...
288 views

### Float-based screen coordinates, higher mouse precision

I wrote 2 weeks ago about problem with motion blur in my engine. When camera moves using keyboard, motion blur is smooth. But when I rotate camera using mouse motion blur is stepping (not sure if I ...
809 views

### 2d coordinates vs x/y screen positioning

I have a 2d top-down view tile map game, that generates random color tiles (water colors) as you move the character. I've been positioning elements on screen using the x/y coords (finding a way to ...
447 views

### Translation from one coordinate system to another having Z-offset issues

I'm using ARToolkit to do an augmented reality application, but my problem is really with the 3D coordinates. In this application, I use my webcam to generate the scene. I have two markers (printed -...
1k views

### Most efficient way to handle coordinate maps in Java

I have a rectangular tile-based layout. It's your typical Cartesian system. I would like to have a single class that handles two lookup styles Get me the set of players at position X,Y Get me the ...
2k 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 ...
2k views

### Spot the difference game design help

I'm thinking of making a spot the difference game. But immediately I stumbled over a problem. I'm thinking of storing a "difference area" in the form of a x,y coordinate. However, because on a ...
688 views

### The ship “shudders” in scrolling Asteroids

In my Asteroids game the user can scroll through space. When scrolling, the ship is drawn in the centre of the window. I use interpolation. I scroll the window uing glOrtho, centering it around the ...
257 views

### Real time data retrieval - database vs file system

I'm planning to develop a game in which I want to draw 3d models in real time using some given x,y,z coordinates. The coordinates will be given at an average of 30 coordinates per second. Drawing will ...