# Questions tagged [coordinates]

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.

329 questions
Filter by
Sorted by
Tagged with
1 vote
187 views

### How to define custom coordinate space?

I'm trying to build small UI framework. And I want it to have a coordinate space such that origin is placed in top left corner (x increases to right, y increases to down). I think for UI it should be ...
• 91
23 views

### Converting mesh vertices to world coordinates for raycasting

My goal is to figure out if a point exists within a 3D polygon. To do this here is what I am doing: Load obj mesh ...
• 101
13 views

### Convert between WCS and OCS using quaternions

I have been scratching my head for days understanding how to fully describe an object fully using just the normal vector and an insertion coordinate. Specifically this is for creating DXF files, but ...
• 101
18 views

### How to position an Image atop a specific point on another Image?

I'm trying to update an older 2D game to run on Unity. One thing it does is place an overworld map with a bunch of icons that you can click on. I've set up a Canvas ...
• 1,083
35 views

### Trying to understand proper naming of transformations and coordinate systems

So far in my code I only dealt with transform matrices that I fed to OpenGL (the 4x4 float matrices), and had a class that was used to do transformations on the CPU side and generate the OpenGL ...
• 163
141 views

### LookRotation function for Z-up, right handed system

I am rendering graphics myself using OpenGL, therefore I need to implement math library myself. I am looking for function Quaternion::LookRotation(forward, up), ...
• 123
16 views

### Finding final global orientation given starting orientation and local delta rotation

An object has a rotation (α, β, γ) in 3D space, using Euler extrinsic rotation (x–y–z). This object also has an additional rotation (Δα, Δβ, Δγ) in local coordinates. How can this information be ...
• 1
146 views

### OpenGL gl_Position z-range and depth buffer range

Am I correct that the OpenGL depth buffer has values between 0 and 1 while the z component of gl_Position is between -1 and 1?
• 125
1 vote
157 views

### How can I get correct coordinates from a diamond isometric map created in Tiled?

I am rendering a diamond isometric map created in Tiled using Monogame.Extended.Tiled package. Here is where I'm trying to spawn a player with an object at ...
• 11
45 views

### Drawing 4D coordinates OpenGL WebGL

Quick question summary: how do I make openGL take 4 coordinates per point into the vertex shader from an array? I will then convert these to 3 coordinates (glPosition.xyz). More detailed explanation: ...
59 views

### Finding points on a face of an icosphere

I am working on a game the ultimately will be a tactical game on the surface of a sphere. To model the surface of a sphere I have chosen to use an iterated icosphere, where each face is iterated quite ...
• 21
1 vote
78 views

### Ensure that random enemies don't spawn just near the player

I need to find a method using which I can ensure that random enemies and objects don't spawn just near the player. In fact, if they do, the player will be more likely to collide with them and lose. ...
• 216
589 views

### How to raycast down to the floor plane to determine world space coordinates in Godot

I've been trying to find a solution to this task and despite finding answers to similar issues, they were always somewhat overcomplicated (e.g. finding a position on a texture) or the problem was ...
• 229
1 vote
172 views

### How do game engines enforce global, engine-specific coordinate systems?

In Unreal, the 3D coordinate system is defined as a right-handed, X-forward, Y-left, Z-up frame of reference; but, the default 3D coordinate system for, say, DirectX is a left-handed, X-right, Y-up, Z-...
• 1,976
68 views

### Calculate how many degrees a physical device is off centre (offset) given X, Y, Z

Let's say I have a physical device that I can rotate with my hands and receive X Y Z coordinates of that device. What I need to calculate is the offset - how far is the pendulum of gravity straight ...
• 3
33 views

### How to check if a particular vector is pointing at X-Y plane or Y-Z plane

As you can observe from the diagram, Vector A is pointing at the Y-Z plane and Vector B is pointing at X-Y plane. Is this possible to find? Am I missing some logic or concept? EDIT: Suppose, Vector B ...
• 301
182 views

### convert world to screen coordinates with camera position and camera angle

Heyho :) I'm trying to convert world coordinates to screen coordinates. I have available: fov, screen width, screen height, camera position, camera angle and obviously the position of the object in ...
1 vote
83 views

### Unity Animation makes object spawn at x0 y0 z0

I was making an animation for a coin in my game in Unity, and when I was testing the full game, I saw that the coin is spawning at x0 ...
• 43
44 views

### What is the math to project a 3D object's center onto a 2D plane?

What I really need is the x,y of the object when it is outside of the screen: I'm actually coding a UI in Objective-C, not a game. In this different kind of UI you navigate a 3D space with objects. ...
• 101
125 views

### Convert Global Space 3D Location to Local object space?

I'm trying to find a formula that could convert my 3D global coordinates into local object space. Here are the inputs I have ...
• 103
34 views

### Gauss-Krüger system to Unity Coordinate Conversion

In my recent project, I am getting an object file via a request to REST API and found that the OBJs (object file) are in Gauss-Kruger System. I want to know that how exactly I place the model as I ...
• 1,848
217 views

### How to use X,Y, and Z instead of Pitch, Roll and Yaw

I'm learning Unreal engine, and I'm rather disappointed because it uses pitch roll and yaw instead of the standard x, y, and z that I'm used to. Is there any way to convert this easily, or is there a ...
• 470
96 views

### Shifting the world origin and scaling all points?

Imagine you have a simulation in very large coordinates, and to render it out you need to scale it down (say, solar system -> fitting inside a few thousand units). This is controlled by a float ...
1 vote
26 views

### Formula to convert zoomed in game space co-ords to UI

I need to come up with a formula to convert variable zoomed-in game space co-ords to UI co-ords. The engine I'm using is not traditional so there's no inbuilt function (convertToUISpace etc). Now I ...
146 views

### Convert GPS coordinates into Unity world space?

I am developing an AR application where a number of historical buildings are spawned around the player depending on his position when a target / QR Code is recognized. I know the Lat/Lon of these ...
• 103
285 views

### Unity - Transforming horizontal distance between two spriteRenderers to set UnityEngine.UI.Button width to this distance

In my Unity scene, I have a couple of spriteRenderers and a UnityEngine.UI.Button called ...
• 144
1 vote
100 views

### 2D Finding an algorithm to check pizza toppings positions

Using unity 3D I am creating a 2D pizza game and I am stuck at finding an algorithm to solve this problem which is Detecting if the pizza is half and half taking into consideration that the user can ...
• 141
64 views

### LibGDX changing actors parents is resulting in unwanted (x,y) translation

I have a Rolodex of task item actors I want to drag to an agenda tablet. My drag and drop functionality is non-native, but came from modifying a book's implementation. The problem seems to be when I ...
74 views

### Diamond shaped map: converting tile number to coordinates and back

I have a diamond shaped map that is displayed as follows: ...
• 23
1 vote
56 views

### How to use WorldToScreenPoint function in a texture context?

I am rendering a scene into a RenderTexture and I have a set of 3D points. I want to convert these points from 3D to texture coordinate frame. It worked, when I rendered into screen and used ...
76 views

### GameObject LookAt not aligning properly

I have a celestial sphere with a plane in the centre and spheres (stars) aligned around the centre with a fixed radius. In order to show the stars visible from a certain latitude and longitude from ...
• 141
54 views

### How to convert point coordinate when taking a snapshot?

Can anyone explain me please how to convert point from Screen-coordinate system to Texture 2D? The screen size say for example 700x500 and Texture2D must be of size 1024x768. I am getting points from ...
173 views

### How to properly resize canvas according to screen size? (Javascript)

So, as the question says I need to resize the canvas according to screen size. However the thing is that that's not it. I also need to have the mouse coordinates updated proportionally. Seems like I ...
3k views

### Unity: AddForce in transform.forward direction not working as expected

I am building a very simple car-driving game in Unity. I have a Player object, which looks like this: As you can see, I have a Rigidbody2d component attached to this object, as well as a script, ...
• 144
92 views

### Conversion between coordinate systems

I have a chunk system that I created for my tile-based game, however I am having problems translating the coordinate in tiles of the cursor to the coordinate in chunks. This is my code so far: ...
• 157
32 views

### Swapping Y and Z in quaternion [duplicate]

I am converting between coordinate systems where Z is the vertical axis in one, and Y in another. I have the rotation values represented as a quaternion. I see this related issue but it's switching ...
91 views

### Scaling a rotated child with parent-child transforms

In unity, if you parent something to another object, then give the child some rotation, and scale the parent, the scale applies to some arbitrary axis to the child, here's some pictures to demonstrate:...
• 141
14 views

### World coordinates on vertical grid game for different aspect ratios (Unity) [duplicate]

new to game development and unity so hopefully someone can help. I want to make a 2D portrait mobile game that will have a grid of constant size where units can move on in Unity. This should support ...
1 vote
128 views

### Dividing coordinate into unit cube

I'm trying to write a Java class to generate Perlin Noise from a Cartesian coordinate. I'm trying to follow this tutorial but I am struggling to understand the theory. Specifically, how do you divide ...
1 vote
91 views

### How to place the origin of an isometric map at the top, not the left

I have an isometric diamond-shaped map. Currently my map origin is to the far left, instead of the top. The green circle at the top-center of the map is where I want the origin point to be, however ...
248 views

### How to convert screen to world coordinates while using gluLookAt / gluPerspective or similar matrix transforms?

I am just starting an adventure in looking under the hood of graphics for a game project I've been working on for a while, and I could use some guidance. I am using Python/Kivy (though that is not ...
86 views

### Latitude and Longitude to Vector3 Not Aligning

I am trying to align a marker sphere to certain places on a bigger Earth sphere based on the inputted latitude and longitude. The following is my code for this conversion, this code is based on the ...
• 141
1 vote
46 views

### Taking cube from camera space to clip space, error in my math?

watching Ken Joy's Computer Graphics lectures on youtube. One thing I'm confused about is after he gets the cube from the camera space to clip space, from my calculations the cube doesn't look like ...
188 views

### Libgdx: converting between two camera coordinates

I had a similar issue to the question here: Why is my text is too large even when scaled to .05f in libGDX? So I created a second camera for my text elements. I'm rendering the text above some other ...
• 135
455 views

### How to create a custom set of coordinates based on two points in Unity?

As the title says, I am having problems finding a way to create a new set of local coordinates based on two points. Here is an example: Consider that the two gameObjects are not one parent of another,...
• 176
1 vote
94 views

### Find the co-ordinates of collided objects in Python

I have a group containing my aliens and another containing the bullets I have fired. When I detect their collisions, I want to pull the alien's x-y co-ordinates during it's deletion so I can put an ...
• 121
2k views

### How does a minecraft biome finder generates map

How does chunkbase biome finder generates map base on seed? I was curious if chunkbase knows the secret formula for generating the map? Or it uses other math formulas such as scaling, mapping etc... ...
• 101
127 views

• 41
1 vote
314 views

### How can I build an array of coordinates of a truncated icosahedron's faces?

I can easily get a list of coordinates of all the vertices—the Wikipedia page has formulae and this page has a list of them, but that doesn't tell me which ones are part of which face. What I'd like ...
• 111
1 vote