Stack Exchange Network

Stack Exchange network consists of 174 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.

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

XMVector3Project is giving offset values when trying to convert world space coordinates to screen space coordinates

I am trying to convert world space coordinates to screen space coordinates for a 2D game so I can work on collisions with the edges of the window. The code I am using to convert world space ...
0
votes
0answers
16 views

creating rotation matrix in a left handed coordinate system from a direction vector

I have been looking at creating rotation matrices from a direction vector in the OpenCV coordinate space and there is one thing that has me slightly confused. Here is an OpenCV rotation matrix, that I ...
0
votes
2answers
44 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
48 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
70 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
64 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
45 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
93 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
104 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
70 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
88 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
108 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
409 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
25 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
36 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 ...
0
votes
0answers
125 views

screen coords to map coords isometric CSFML

I am implementing a game with 2d/isometric graphics using a height-map. Map looks like this: https://i.imgur.com/xEcZAwm.png I'm having a hard time converting from screen coordinates (ie a mouse ...
3
votes
1answer
285 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
89 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 ...
0
votes
0answers
39 views

Intercept an object with circular orbit

I basically have the same question : How can I Intercept object with a circular motion I tried implementing DMGregory's answer, but it looks like I always get the closest point from the ship in the ...
1
vote
1answer
103 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
140 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
79 views

Coordinate system not working properly! OpenGL

I am learning opengl and tried to add texture to a rectangle using ...
1
vote
0answers
201 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
137 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
303 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
0answers
205 views

Lat, Lon and elevation Conversation into unity coordinates

I have came across a really vague project problem and its feasibility report or communication procedures I have to define. And here is the scenario: I have two applications One is built on Unity3d (...
1
vote
1answer
233 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
77 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
138 views

OpenGL NDC initial values

I have a set of vertex locations to create a plane: ...
0
votes
0answers
379 views

Creating a rotation matrix from an up vector without using trigonometry

I'm looking for someone who really understands vector and matrix algebra. I have a coordinate in 3D space whose origin is the centre of the Earth, and I want the coordinates to be on a flat plane at ...
0
votes
1answer
271 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
363 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
724 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
376 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
139 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
535 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
48 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
0answers
691 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 ...
-1
votes
3answers
443 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 ...
1
vote
1answer
82 views

How to work properly with different coordinate-systems

Let's say we got a little set {S} wich has 4 possible coordinate systems (LH=left handed, RH=right handed): LH-y_up LH-z_up RH-y_up RH-z_up Now, let's say my Opengl engine is using a RH-y_up ...
1
vote
1answer
29 views

Tracking playing position into an array

I'm trying to track playing position every 500ms which i can do but i need it to populate an array which i save to a txt file as a comma delimted list or something. I have this code so far (which ...
2
votes
1answer
1k views

Convert quaternion to a different coordinate system

OSVR has a right-handed system: x is right, y is up, z is near. I need to convert orientation data from a sensor in OSVR to a different right-handed system in which x is forward, y is left, and z is ...
0
votes
1answer
1k views

clip space, normalized device coordinate space and window space in OpenGL

I am learning OpenGL. Clip space, normalized device coordinate space and window space are confusing. I searched but still don't understand them clearly. So, the question is- what are differences ...
0
votes
1answer
80 views

Map Positions in LibGDX

I am developing an RPG game where there is a main world map, locations such as towns or ruins on that map and buildings in those locations where players can interact to go into. For example, I have a ...
0
votes
1answer
360 views

Mapping polar coordinates to cube

I am trying map polar coordinates to points on a cube. I was able to map the front, back, left and right faces of the cube, but I am struggling with the top and bottom. Here is what I have: ...
0
votes
1answer
707 views

Calculate position on Isometric grid

I created the following tile grid in unity3d: The blue dot is the absolute center point (0,0) of both scene space and tile map. Now I am trying to calculate the X/Y position of points on the tile ...
1
vote
1answer
78 views

Problem with Rotating Third Person Radar UE4

I am doodling on the Flying game template on UE4. I am making a 2D radar on top left. Radar's north direction is the pawn's forward direction. So when it approaches to an object with the dotProduct ...
0
votes
1answer
183 views

Why Won't Image Drawing Work In JavaScript

In my game at the beginning the first thing that you'll see is a campfire with this code: ...