Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

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.

0
votes
1answer
28 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 ...
1
vote
0answers
54 views

Unity Co-ordinate system to latitude longitude conversion floating point precision lost

I am using a Github script (Unity GPS Convertor) to convert unity co-ordinate system x,z into latitude and longitude. It is actually working fine but the problem is, when I go farther from the origin (...
0
votes
2answers
32 views

How can I set decimal values to a Pygame rect position?

I'm trying to make the gravity a bit slower, like ...
0
votes
0answers
34 views

How can I get rid off the imprecision of the model matrix when I using WGS84 as the coordinate system to render the earth?

The global coordinate of WGS84 is too big, a float is not accurate enough. The only two ways I can come up with are using dmat replace for mat or transferring the modelview matrix rather than the ...
1
vote
1answer
34 views

How can I convert screen coordinates from a click to 2D scaled world coordinates?

I need a way to convert screen coordinates obtained from mouse clicks to world coordinates in my 2D game. To create a zoom effect controlled by the user, before drawing a model I will scale all of it'...
3
votes
1answer
45 views

How to invert a Tilemap's coordinate system?

The Tilemap object in Unity uses a coordinate system that grows up-right from (0,0). (ie. with the Origin at the bottom-left of the screen.) I'm trying to represent a mapping system that has the ...
1
vote
1answer
27 views

Spine + MonoGame > viewMatrix / camera offset

we switched from frame by frame animations to Spine (this animation software). The issue I am facing now, that it am unable to fit it in our coordinate system. (simple 2D game) I guess there is an ...
0
votes
1answer
47 views

Handedness of 2D coordinate systems

I know that there's always a big debate on the handedness of 3D coordinate systems, but I can't seem to find any information about the handedness of 2D coordinate systems. Usually, the X axis points ...
0
votes
0answers
8 views

Calculating offset for translation between layer and world

When translating offsets between two coordinate systems, I'm using xOffset = Math.Abs(System2.StartPosition.X) - Math.Abs(System1.StartPosition.X) yOffset = Math.Abs(System2.StartPosition.X) - Math....
0
votes
1answer
86 views

Alternatives to Camera.main.ScreenToWorldPoint in Unity

What are alternatives to Camera.main.ScreenToWorldPoint in Unity? So, here is my code (just the piece which is relevant for the question): ...
0
votes
0answers
25 views

Swapping Axis by Swapping Matrix Rows

I'm using MathGeoLib, which uses row-major storage. The problem that I'm facing is that I'm going from a East-North-Up(ENU) coordinate system. And I need to go to an East-Up-North(EUN) coordinate ...
0
votes
1answer
27 views

Unity: How do I get the coordinates of the vertices of a blender mesh?

I have gameobjects in my scene called icospheres that I have made in Blender, and I am trying to get the coordinates of their vertices. Below is an image of my scene; each triangle is a separate ...
0
votes
0answers
33 views

Center of World Map not the same as the center of my Bullet Physics World

As you could see in the image, the center of my map should be located at the intersection of the diagonal lines. When I import 3D buildings within the area into my Bullet physics world, I want to set ...
0
votes
1answer
64 views

How to convert coordinates between world coordinates and screen coordinates

I am using a tilemap in which I have square tiles. Knowing that, the size of the screen and the player position(in world coordinates) how I convert between this systems? Is there any formula? EDIT: ...
1
vote
1answer
280 views

Convert global 3d coordinate system to a local one with specific direction

Imagine a (x,y,z) coordinate system within a solar system, with (0,0,0) beeing the center of sun where Z axis goes thru both solar poles. I'm standing on a planet inside a house within that solar ...
0
votes
1answer
35 views

2D converting absolute top-down coordinates into relative third-person coordinates

I'm working on 2D top down zombie game. I started working on it as having a static 2D map and on every tick you update the coordinates of every object, including the player itself relative to the ...
0
votes
2answers
46 views

How to geographically locate the position of character on a map?

Beyond the different coordinates systems (x/y, ...), imagine you draw the map of your world on a bitmap, png, gif or whatever image. Then you got your world and you'd like your players/character (PC) ...
1
vote
2answers
83 views

How to access coordinates of objects in bullet physics (libGDX)?

I need to access the x, y and z coordinates of a bullet physics object. I'm assuming this is done via the transform matrix, but I have no idea which values mean what. There doesn't seem to be any ...
0
votes
0answers
125 views

Unity WorldToViewportPoint not giving correct results

I have a script that places an UI element on the place where a 3d object is in 3d space. I do this in the following way: ...
0
votes
1answer
68 views

Can I position a player avatar behind the camera based on rotation?

I'm currently reverse engineering a video game where what's rendered on the screen depends on the proximity of the player avatar to the camera. As such, for my freecam to work properly, I need to ...
0
votes
1answer
47 views

Are constantly growing (in dimensional size) GameObjects a problem?

It's possible the following is fundamental to Unity, and not a problem? I am using an example of a WheelJoint2D/Car from the Ray Wenderlich tutorials. Note from the pic below, the top level game ...
1
vote
1answer
111 views

Convert Canvas Space point to local space of a rotated rect?

I got a quite tricky problem: I have my mouse position and my rectangle position in canvas space(screen space but with adjusted scaling). Now I want my mouse position converted to local space of the ...
0
votes
1answer
219 views

How to know if mouse coordinates is delta or absolute on Window and Android in Unity?

I wrote sample application, that allows to "rotate" object by mouse. Rotation occured by rotating of camera object around central object and the code is following: ...
0
votes
1answer
75 views

What am I missing for this flycam to work correctly?

Through reverse engineering, I've found an instruction to inject on which allows me to obtain the XYZ coordinates of the camera, as well as pitch and yaw. Thus, I have the following: camX (Plane)...
0
votes
2answers
106 views

Converting between world coordinate systems

I have a mesh (verticies, indicies, normals).This mesh uses following world coordinate system: Forward: x Up: z Right: y I am trying to convert it to a different coordinate system: Forward: z Up: y ...
0
votes
2answers
142 views

Getting position of a coordinate on the surface of a sphere

So I want to create a object B close to another object A, but I'm trying to avoid that A covers B: I have thinking how to achieve that. Take a look of the following drawing: I have been thinking in ...
1
vote
1answer
605 views

How can I move a vehicle using speed and steering angle?

I want to drive a vehicle in x and y coordinate area with range from (0,0) to (6000,5000). I am using Visual Components (using Python API). On input I have speed data and steering angle of wheels ...
2
votes
0answers
27 views

Defining a coordinate system for player residing in another coordinate system

I'm making a game and I wanted to simplify some code by taking advantage of linear algebra. I'm a little stuck. Let's say the player (green triangle) resides in a coordinate system where the x-axis ...
0
votes
1answer
37 views

Calculate the amout that should be added or subtracted to x and y axis with rotation?

Say I have this figure: How would I calculate the amount I must add or subtract to x and y axis to get the cube to move in the direction its facing? The rotation is a float 0 - 360 and 0 is straight ...
3
votes
1answer
348 views

Finding all hexagonal grid coordinates inside cover arc

I got a turret that points at the corner of hexagon (point A). It can shoot in cover arc that's shown here: I need to check if my target lies within this cover arc. From this tutorial: Hexagonal ...
1
vote
0answers
114 views

How can I adjust the origin for 2D UI in OpenGL?

As I am quite used to screen geometry, where 0,0 is at the top left corner or the screen (as it is for just about every desktop app and Web app in the world), but I find it very hard to actually ...
1
vote
1answer
129 views

Calculate movement in 2d

In 2d, I have a ship that I want to have move to specific coordinates. I've used Sidar's answer in How do I calculate how an object will move from one point to another? to get something that works ...
1
vote
0answers
166 views

Convert a quaternion from one coordinate system to another, which are not orthogonal to each other

I found a similar question like this in the following link: https://stackoverflow.com/questions/18818102/convert-quaternion-representing-rotation-from-one-coordinate-system-to-another/18818267 In ...
0
votes
1answer
88 views

Coordinate system not working properly! OpenGL

I am learning opengl and tried to add texture to a rectangle using ...
1
vote
0answers
255 views

Is there a way to get mouse coordinates relative to an sfml window without locking the mouse to the window border or monitor edges?

As the title states, is there a way to get the relative mouse coordinates to the sf::RenderWindow without locking the mouse cursor inside of the window border or monitor edges? In glfw using a mouse ...
3
votes
1answer
169 views

How to remap world space to screen space?

I am noob to game development, and while using a simple graphics library in Python to make a 2D game, I noticed that the coordinate system of the library had its upper left corner as (0,0), whereas ...
1
vote
1answer
415 views

Calculating the latitude & longitude of a raycast hit point on a sphere

I am working on a game where you look at a sphere and get the latitude and longitude of the position. I get the position on the globe with a raycast along the direction the user is looking. Using ...
0
votes
1answer
247 views

Lat, Lon and elevation Conversation into unity coordinates

I have came across a very vague project problem and its feasibility report or communication procedures I have to define. And here is the current scenario: I have two applications One is built on ...
1
vote
1answer
269 views

Update and merge Unity coordinate systems multiplayer - Hololens

Project Summary Creating a multiplayer HoloLens app that allows players to spawn and move objects around the local space they share. Problem I am able to connect to the other HoloLens and see the ...
0
votes
1answer
82 views

Field of view or resolution?

I'm new to CG and I'm building a ray tracer. I don't quite understand how to set camera parameters and film(pixel plane) parameters. Say I want to get an image of 400x300 resolution. I can set an ...
0
votes
2answers
166 views

OpenGL NDC initial values

I have a set of vertex locations to create a plane: ...
0
votes
1answer
327 views

Position Text Mesh above parent transform in world space

I'm making an isometric-ish 2d game in Unity. I want to display text above a sprite during certain conditions. For this, I'm using a TextMesh instantiated as a child of the sprite. In local space, ...
2
votes
1answer
443 views

How to spawn GameObject exactly in front of another object?

I'm working on a 3D game in Unity and I'm having a problem trying to spawn an object exactly in front of a wall in my game, like hanging a picture on it. I don't want the object to look like it's too ...
1
vote
1answer
919 views

Why does the Debug.DrawRay return these weird lines

I am working on a small feature of a 2D mobile game where a indicator points towards a object in 2D space. I am trying to make the indicator turn towards the object, however the vector I am trying to ...
3
votes
2answers
430 views

How do you transform a coordinate system from Cartesian to Isometric?

Apologies if my example is a bit contrived, I've been trying to figure out how to apply matrix transformations to this coordinate problem, and I'm not getting the right output. I need to understand ...
1
vote
1answer
141 views

Why is the movement space increasing?

This is a follow-up question to my previous question. I got my key holding to move, using boolean variables and making another method with a ...
4
votes
2answers
602 views

How can I make players move diagonally at equal speeds?

In a tile-based 2D RPG, a character is supposed to walk into all eight directions. However, if we blindly tell the player to move in the direction (1, 1), he will be around 41% (√2-fold) faster. Thus,...
0
votes
1answer
49 views

Move object towards the center of coordinating system

I would like to move a object towards Vector2(0, 0), but every time I use this script, the object always goes down, instead of going towards the center of the coordinate system. ...
3
votes
1answer
901 views

Deproject Screen To World Coordinates (Unreal Engine 4.15)

I am working on a small game in Unreal Engine 4.15 using blueprints only and encountered a behaviour I don't understand. The game is based on the Top Down Example. As I'd like to teleport an actor ...
0
votes
3answers
534 views

Tile detection on a 2D isometric layered diamond shaped map - What are the math?

What are the math for tile detection on a 2D isometric layered diamond shaped map ? Here is an image of a layer (this is an image from an old folder, I didn't write the display yet for my current ...