Skip to main content

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.

Filter by
Sorted by
Tagged with
0 votes
0 answers
32 views

Obtaining randomGenerator's seed for Ender Crystal spike generation (pre-1.9)

I had an old world of mine that I wanted to re-create. I managed to obtain the world seed, so the Overworld and the Nether were ready, but the End not so much. Even though the island was generated ...
Alex Laredo's user avatar
1 vote
0 answers
126 views

How to use screen space coordinate of the mouse to set a model position in game?

I'm trying to make a movement system in my game where you click the mouse and your model moves towards where you clicked on the landscape, my understanding is the normalized screen coords go from [-1,...
jade22's user avatar
  • 11
1 vote
1 answer
72 views

Mouse coordinates to world space offsetting?

so i'm trying to make a mouse to world space function, and I seem to always end up with the rays cast offsetting. I've looked at numerous tutorials, tried numerous examples. Tried with ...
Valtsuh's user avatar
  • 139
0 votes
1 answer
44 views

Which coordinates should I use to generate a 2D lightmap properly?

Recently I noticed that my 2D lightmap rendering has an issue - lighted area is getting rendered as far from the actual light source as the world coordinate of the light source grows. E.g. when world ...
Steyrix's user avatar
  • 225
1 vote
1 answer
122 views

remaking Pong in Godot but the opponent AI cannot locate the ball's coordinate correctly

I'm following a detailed YouTube tutorial on remaking Pong in Godot 3.0 but I have ran into an issue regarding the way the AI opponent reacts to the incoming ball, what's happening is that the ...
buzzbuzz20xx's user avatar
0 votes
0 answers
61 views

Isometric building system and coordinate calculation

I am a Unity newbie and trying to implement a simple building system in a prototype of the game. The scenario is: Clcik on the UI Button Move the coursor to the desired position Click left mouse ...
Valeriy's user avatar
  • 13
0 votes
1 answer
97 views

Normalized coordinates not translating to screen coordinates the way I need them to

I am making a simple game in C# using pictureboxes. I want to move a picturebox on a form. Once this picturebox is placed in a new location, I normalize its X,Y coordinates between [0, 1] and then ...
CluelessWizard's user avatar
0 votes
1 answer
45 views

Checking if I am looking through a window using angles

I am developing a mod for a game with a Lua api. I am trying to detect if I am looking through from behind a window when I shoot an enemy. For context, when I shoot through this window I apply a ...
Ben R's user avatar
  • 1
0 votes
0 answers
62 views

Is this gimbal lock I'm hitting even with rotation matrices / quaternions?

I'm spawning a trigger box relative to another object using local offset. The engine I'm using does not provide a native function to make that conversion (at least in a way accessible to me), so I am ...
Drew's user avatar
  • 176
1 vote
1 answer
74 views

Selecting Tiles Correctly With Scroll

I would like to understand the process of selecting the correct tile from a scaled Surface when I have information about the number of tiles on the x and y axes, the length of the Surface, and also ...
anathrax's user avatar
0 votes
0 answers
79 views

Get coordinates of clicked point on screen in model space

There is a 2D object located in the coordinate range -1 to 1. In world space, it is also located in these coordinates, but with a shift along the z axis. The actual initialization of the model, view ...
Ar4's user avatar
  • 1
0 votes
1 answer
90 views

Is vertex coordinate limited to -1 to +1f range

I thought that everything outside of [-1.0f, +1.0f] should not be renderable in Open GL. However, this code renders just fine with Silk.NET. I draw 3 axes and one ...
Anonymous's user avatar
  • 111
0 votes
1 answer
63 views

How do i put an entities x,y and z coordinates to a variable(?) in Blitz3D?

I'm making a TEST 3d platformer where the camera follows the player from above. Normally I would make the camera move at the same time when the player moved, for example: ...
Probes's user avatar
  • 1
0 votes
2 answers
169 views

Convert terrain vertex position to global position

I am trying to set the terrain's heights data at runtime with a simplex noise function, while stumbling with converting the local position of the vertices to global position to use as input to keep ...
Willem's user avatar
  • 165
0 votes
1 answer
181 views

Changing GameObject Position with the new InputSystem Unity 2D

I am making a little top-down 2D RPG right now and I'm struggling with the range of my attacks. The problem is that my range is stuck on the right side of my player. This is of course really annoying, ...
Hammynator's user avatar
0 votes
0 answers
45 views

Resample image of sphere to match appearance of rotation

I am rendering sphere to a texture. Now, I have screen space texture, and I need to offset this texture based on screen space movement (dx, dy) and render it to a new texture. For example, the left is ...
Martin Perry's user avatar
  • 1,116
3 votes
2 answers
2k views

How to convert a 4x4 matrix transformation to another coordinate system?

Is there a general method to convert a matrix transformation from one coordinate system to another, so that the resulting transformation looks the same on screen? For example: There are some ...
thalm's user avatar
  • 257
1 vote
1 answer
578 views

Algorithm for taking the shortest path between two XY coordinates

I am making a simple game in Phaser (but the library doesn't really matter). I have an enemy that is moving towards the player on a 2 dimensional grid. I have written some code that makes the enemy ...
yesman's user avatar
  • 113
0 votes
1 answer
51 views

Changing Coordinate Origin [From Coord System A -> Coord System B]

I'd really appreciate some help on this one. Given 2 coordinate systems A and B where xA is an initial Vector3 position, rA is an initial Quaternion rotation xB is an initial Vector3 position, rB is ...
G.Pap's user avatar
  • 3
-1 votes
2 answers
270 views

Why does the setPosition function in SFML require the x and y arguments both floating-point numbers, not integers?

Why do the coordinates x and y in the 2D game both floating-point numbers, not integers? For example, the SFML setPosition function requires two floating-point ...
Đạt Phạm's user avatar
0 votes
3 answers
107 views

Should the coordinates, and rotation angles of all the sprites be stored in variables?

I've learned that magic numbers are bad in code. However, should the coordinates, and rotation angles of all the sprites be stored in variables? Is the convention in game development to leave those ...
Đạt Phạm's user avatar
0 votes
1 answer
265 views

Bottom-left cell position is incorrect?

I need to get the position of the bottom-left cell on my tilemap. I used Floor.CellToWorld(Floor.cellBounds.min) (Floor is the name of my tilemap) and I used Gizmos ...
Arian_ki's user avatar
  • 691
0 votes
1 answer
716 views

Calculate the coordinates of an offset in 3D space knowing the initial rotation and final rotation of the object [closed]

Working on a game mod in FiveM in which I am representing bullet impacts with drawn lines in the game world along their flight path. I am getting a normalized vector and then calculating the offset ...
user2828652's user avatar
1 vote
1 answer
311 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 ...
ChessMax's user avatar
0 votes
1 answer
120 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 ...
joethemow's user avatar
  • 101
0 votes
0 answers
65 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 ...
Newline's user avatar
  • 173
2 votes
1 answer
637 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), ...
Andy's user avatar
  • 123
0 votes
1 answer
1k 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?
wedesoft's user avatar
  • 125
1 vote
1 answer
291 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 ...
Emobe's user avatar
  • 11
2 votes
0 answers
229 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 ...
Amabaku's user avatar
  • 21
1 vote
1 answer
231 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. ...
Salem's user avatar
  • 226
8 votes
1 answer
3k 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 ...
Marty Cagas's user avatar
1 vote
1 answer
592 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-...
Casey's user avatar
  • 2,055
0 votes
1 answer
95 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 ...
lipa's user avatar
  • 3
0 votes
0 answers
97 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 ...
MrRobot9's user avatar
  • 331
0 votes
1 answer
3k 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 ...
itsame's user avatar
  • 1
1 vote
1 answer
287 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 ...
GospelBG's user avatar
0 votes
0 answers
125 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. ...
Vulkan's user avatar
  • 101
0 votes
1 answer
614 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 ...
DB3D's user avatar
  • 103
0 votes
0 answers
74 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 ...
Muhammad Faizan Khan's user avatar
0 votes
1 answer
1k 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 ...
Millard's user avatar
  • 500
0 votes
0 answers
225 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 ...
HateDread's user avatar
1 vote
0 answers
30 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 ...
Mushington's user avatar
0 votes
1 answer
569 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 ...
Steffan's user avatar
  • 103
0 votes
1 answer
703 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 ...
ChrisC's user avatar
  • 116
2 votes
3 answers
156 views

Algorithm to check whether pizza toppings are divided half-and-half

Using Unity, 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 put ...
A.J's user avatar
  • 151
0 votes
1 answer
127 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 ...
RocketScienceGuy's user avatar
2 votes
1 answer
232 views

Diamond shaped map: converting tile number to coordinates and back

I have a diamond shaped map that is displayed as follows: ...
Frank's user avatar
  • 23
1 vote
1 answer
135 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 ...
Hillbilly Joe's user avatar
0 votes
1 answer
151 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 ...
SidS's user avatar
  • 171

1
2 3 4 5
7