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.
354 questions
0
votes
1
answer
134
views
In game engines and 3D rendering, which coordinate system results in the least amount of operations to transform and render scenes?
I understand this is a slightly esoteric question, but its something I've constantly asked myself over and over when using various 3D design tools and game engines.
In what way should models be facing,...
0
votes
0
answers
65
views
GPU-friendly coordinates for hyperbolic geometry
Perspective Euclidean rendering makes use of the W coordinates in a 4-component vector by recording distance information into it and let GPU do the scaling/normalization.
Hyperbolic and non-Euclidean ...
2
votes
0
answers
84
views
How to convert a quaternion to another coordinate system where y and z are inverted?
I have quaternion representing a camera pose in a coordinate space called "World Frame 2":
x+ = right
y+ = up
z+ = out
...and I want to convert it to another space called "World Frame ...
0
votes
0
answers
59
views
OpenTK (C# OpenGL) Coordinate mistake
I am trying to make a 2D renderer using OpenTK and I am having trouble with the coordinate system. I have followed an opengl sprite tutorial and the Size vector is ...
1
vote
0
answers
271
views
Converting a Transform from Unity's Coordinate System to Unreal Engine's
I am trying to convert a transform from the Unity Coordinate System to the Unreal Engine Coordinate System (and others).
Ideally, I want to take a position, rotation (in Euler angles), and a scale as ...
0
votes
0
answers
76
views
Physics in a wrapped world
I'm working on a 2D game that takes places in a wrapped, toroidal world. Having implemented dynamic chunk loading and unloading in this setting, and a camera, I'm beginning to dread the idea of ...
0
votes
1
answer
152
views
3D-lighting considerations
I'm considering how a graphics-engine lights any given environment, at the level of code.
So I guess perhaps the simplest way to light a scene is just to provide a Value-figure (i.e. Value as in the ...
0
votes
3
answers
452
views
How do large physics based games (space engineers) deal with coordinates
I have recently been looking into physics engines and low level computing. At some point id like to make my own engine down the road.
Something I can't seem to find an aswer for is how physics based ...
0
votes
1
answer
242
views
How to live on sphere?
What I want to achieve
I want to generate sphere planet world, seamless of course, for RTS game like Planetary Annihilation: TITANS, which means I want:
place walking agents on sphere, move them on a ...
1
vote
0
answers
171
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,...
1
vote
1
answer
161
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 ...
0
votes
1
answer
85
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 ...
1
vote
1
answer
188
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 ...
0
votes
0
answers
127
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 ...
0
votes
1
answer
240
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 ...
0
votes
1
answer
81
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 ...
1
vote
1
answer
109
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 ...
0
votes
1
answer
235
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 ...
0
votes
1
answer
114
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:
...
0
votes
2
answers
324
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 ...
0
votes
1
answer
249
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, ...
0
votes
0
answers
54
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 ...
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 ...
1
vote
1
answer
762
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 ...
0
votes
1
answer
92
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 ...
-1
votes
2
answers
344
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 ...
0
votes
3
answers
155
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 ...
0
votes
1
answer
335
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 ...
1
vote
1
answer
372
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 ...
0
votes
1
answer
187
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
...
1
vote
0
answers
110
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 ...
2
votes
1
answer
713
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), ...
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?
1
vote
1
answer
413
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 ...
2
votes
0
answers
319
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 ...
1
vote
1
answer
322
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.
...
8
votes
1
answer
5k
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 ...
1
vote
1
answer
974
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-...
0
votes
1
answer
164
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 ...
0
votes
0
answers
135
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 ...
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 ...
1
vote
1
answer
342
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 ...
0
votes
0
answers
160
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.
...
0
votes
1
answer
707
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
...
0
votes
0
answers
97
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 ...
0
votes
1
answer
2k
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 ...
0
votes
0
answers
272
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
0
answers
49
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 ...
0
votes
1
answer
657
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 ...
0
votes
1
answer
766
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 ...