# Tag Info

Accepted

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

This is caused in the history. Early computers had Cathode Ray Tubes (CRTs) which "draw" the image with a cathode ray from the upper left corner to the lower right. To ease the interface between the ...
• 760

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

Okay, so Assuming that you know what the World Transformation matrix for that object A is, You just need to construct the inverse of that matrix and you will have what you need. Suppose the rotation,...
• 1,472

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

r: radial distance θ: inclination φ: azimuth via Wikipedia ...
• 1,915
Accepted

### Is a custom coordinate system possible in Unity

If what you want is to bypass the floating inaccuracy caused by single point precision problem, for the sake of creating bigger environments for your game, then it depends on what you are willing to ...
• 4,885
Accepted

### How to use the SDL viewport properly?

My guess is you're trying to implement a camera, and should not be using SDL Viewports. The viewports are for UI elements like menus, minimaps, etc. It's a way of dividing up the screen into multiple ...
• 5,856

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

I've done this with trigonometry rather than matrixes in the past (I am a matrix noob). Ashes999's answer is halfway there, get the relative vector, then rotate that by the inverse of EntityA's angle. ...
• 91

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

That's a question that frequently pops up. I will take the liberty to forward you to another fairly detailed answer I already gave to the same issue, instead of just repeating it here: Is a custom ...
• 4,885
Accepted

### Get local coords from global coords

The point P to be transformed is, in homogeneous coordinates: $$\begin{pmatrix} 50 \\ 40 \\ 1 \end{pmatrix}$$ The homogeneous transformation matrix M is (using $cos(\frac{\pi}{4}$) = sin(\\$\frac{...
• 2,101
Accepted

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

You're thinking in very static terms. Just because an object is half a world away doesn't necessitate any issues. If entity coordinates are stored relative to chunk rather than relative to world, ...
• 29.1k
Accepted

### How do I convert screen coordinates to between -1 and 1?

Your description is a bit vague, but it sounds like what you're trying to do is map coordinates from one space (the window coordinates) to another (your tile coordinate space). Doing so is a simple ...
• 3,781
Accepted

### Convert Screen coords to World Coords LIBGDX

Try using this Camera:unproject method: ...
• 935

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

Let me try to give you something somewhere between The Light Spark's answer and Elliot's answer, because from what I read, you're really looking for an algorithm to follow and not just math tossed at ...

### How can I randomly generate objects inside of a Complex Area?

Triangulate the area. Pick a random triangle. Generate a random point inside that triangle (link).
Accepted

### Finding all hexagonal grid coordinates inside cover arc

I prefer to do hex-cell coordinate math in what Amit calls cubical coordinates on your linked page. For the rest of this answer, (X, Y, Z) will refer to cubical coordinates. Basically, for any of ...
• 8,954
Accepted

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

http://blog.nobel-joergensen.com/2010/10/22/spherical-coordinates-in-unity/ ...
• 7,021
Accepted

### How to match user click and the sprite object position in libGDX framework

Before using the coordinates of your touch event, you need to scale them to your camera dimentions. You can try this code : ...
• 706

### What are the advantages/disadvantages of using a polar coordinate system in a video game?

Short answer: Polar coordinates are a non Euclidean coordinate system. This means that lines created in this coordinate system are not straight, so it isn't usually used as the primary coordinate ...
• 757

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

This is a great question that I've thought of many times. The simple answer to "why" is because TV formats also drew their lines from left-to-right then top-to-bottom. Original computer monitors were ...
• 308
Accepted

### Finding a tile number in a grid system

The only way I know of, or at least can think of right now, is the following: Prerequisites: You need to know the width and height of your grid the tile numbers must increase successively, so like ...
• 163
Accepted

### Handedness of 2D coordinate systems

It entirely depends on what you want to do with it and both have reasons why they exist. The one where the top left corner is the origin and the positive xes point away from them are based on the way ...
• 14.5k
Accepted

### How do I get the mouse coordinates relative to my whole scene with Monogame?

I don't have a specific example for an Isometric camera, but it sounds like you are asking about the basic camera system in general. The camera I use in my games is somewhat simple and is illustrated ...

### Colision detection of disc (Maximum Material Condition aka "Flatness")

I'm not entirely sure I understand the question but, given a 3D point cloud with a 2D "shape" (like a disc) the problem is simply one of dimension reduction. The algorithm you're looking for is ...
• 924

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

Addendum: Early graphics were done on vector monitors, just one step up from the oscilloscopes seen in the lab where (0,0) would be in the exact middle of the screen, subject to some knob turning to ...

### Is a custom coordinate system possible in Unity

I doubt that there's a way to change the coordinate system Unity uses internally for its transforms/physics/etc. Not without recompiling the engine source at least. But that may not be necessary to ...
• 112k
Accepted

### LibGDX Overlay Game with Stage

You need to project from the worldspace to screen space using the correct camera, not the project method on the Vector2. Then ...
• 4,226

### How can I randomly generate objects inside of a Complex Area?

This might not be the most elegant solution, but it might work for you: Define that shape as a PolygonCollider Get the bounding box of that collider (...
• 111k

### Convert quaternion to a different coordinate system

Summarizing your two coordinate spaces: ...
• 112k
Accepted

### Why does the Debug.DrawRay return these weird lines

You're drawing Rays, not Lines. This means that the second parameter is a direction not a point in space. https://docs.unity3d.com/ScriptReference/Debug.DrawRay.html Draws a line from ...

Only top scored, non community-wiki answers of a minimum length are eligible