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
2answers
38 views
Unity 2d coordinates
I'm trying to get a 2d tilemap rendering but somethings not clicking with me about the 2d coordinates...
Here's my basic tilemap class -
public class Map : MonoBehaviour {
public Transform ...
0
votes
3answers
78 views
How to use traditional pixel coordinates system in modern OpenGL? (3.1) (with C++/GLFW)
This question is very similar to my other question, however the solution provided there does not work when using OpenGL 3.1. glOrtho seems to do absolutely nothing no matter where I call it in OpenGL ...
1
vote
0answers
46 views
Getting world coordinates from mouse position
I am drawing a 2D mesh imported from CAD. The mesh vertex coordinates are in feet from some arbitrary origin and Z is always 0. I am supplying the coordinates to my shader program and using projection ...
0
votes
1answer
43 views
LibGDX: How do I manage Player position?
I'm making a 2D isometric tiled game using LibGDX. In my Player class, I created a vector2 that I named 'pos' to manage the player position, then I draw my Player with:
batch.begin();
batch....
0
votes
2answers
35 views
Difference in Shading Using Eye Space or Model Space Coordinates
While reading on shading, I came across a section in which the artist provides 2 different kinds of fragment shading:
Coloring using model space and eye space.
The result is as illustrated in the ...
0
votes
2answers
36 views
How do I get the 3d coordinates of my model Instance? [LibGDX]
I want to get the 3d coordinates (as a Vector3) from my model Instances.
with the following code I can only get the original coordinates, but in the render method, my model is rotating around the Y-...
0
votes
1answer
17 views
How to check mouse coordinates and mouse events
I'm building a simple game where if the mouse's X coordinate is greater than 200, and you click, the screen will turn red. Here's the code:
var mouseX = event.clientX;
var mouseY = event.clientY; ...
0
votes
0answers
19 views
how to represent rotation quaterion to another coordinate system
I am trying to combine rotation information from two system in a VR/AR scenario, one is a computer vision solution/ visual SLAM coordinate, initializing the first frame as the world origin as position[...
1
vote
1answer
38 views
How to handle edge cases for a cell divided multiplayer world?
The most common practice that I read about for overcoming floating point precision in video games with large worlds is by dividing the world into cells and load it with player's position and shift ...
4
votes
1answer
60 views
how to create an outlined polygon with vector3 coordinates?
I have a set of vector3 coordinates and I use them to draw a polygon in another app, my question is: how can I calculate a second set of coordinates to make it look like the line is outlined.
in ...
0
votes
0answers
25 views
Spritekit view and scene coordinates
I have a goal sprite that I want always to be fixed in the top right corner of the scene. I use method:
[self.view convertPoint:point toScene:self];
from the scene. It still ends up differently in ...
1
vote
1answer
55 views
Get different result on different devices (same resolution) after setVelocity
I'm dying with physics , i've tried to use setVelocity however i got slightly different value from different devices.
I've tested on iPhone 5 (on simulator)
and iPhone 6 (real device)
The Director::...
1
vote
3answers
71 views
How do I calculate NDC coordinates in a fragment shader?
I have some weird problem going on in my openGL shader.
First,, I pass the viewspace position from the vertex shader to the fragment shader like this:
vec4 view_pos = V * M * vec4(world_position.xyz,...
1
vote
2answers
84 views
Finding a tile number in a grid system
Hi I am trying to find the Tile number of a grid of tiles based on the Z and X coordinates.
Where the Z and X axis are potentially infinite in either direction how can i get the number of the tile, ...
0
votes
1answer
48 views
GLFW VBO in World Space
Last year I wrote a basic 3D game for one of my modules using freeglut. Everything was fine and dandy because I used the deprecated immediate-mode of drawing things (glBegin, glVertex, glEnd) for ...
1
vote
2answers
98 views
clamp a 2D coordinate to fit within an ellipse
I need to clamp a 2D coordinate to fit within an ellipse.
Call of Duty: Modern Warfare 2 does something similar where capture points are translated from a 3D vector in the world to a 2D screen ...
2
votes
0answers
39 views
Pixel Check With Node.js [closed]
I'm trying to check if a pixel of a certain color at (x,y) has moved within a boundary of [(x1,y1),(x2,y2)] and also update its new position to console. I'm doing this as a desktop application so no ...
1
vote
0answers
101 views
Isometric map (2D) - Click detection - Mouse mapping - How to implement it? [duplicate]
I'm building an isometric engine.
I use TILE_SIZE * TILE_SIZE (minecraft like) tiles.
(I'm using 64 * 64 tiles but I can change the number when I want)
I can access for each tiles to this ...
1
vote
0answers
25 views
Rectangle in object-layer has wrong coordinates in game
I extended the SuperKoalio LibGDX Example about an Tiled Object Layer in the Tiled Level-Editor and draw a rectangle on this layer.
Now I would like to draw this rectangle in my game using the ...
4
votes
1answer
95 views
Virtual game dimensions - how to implement?
I'm creating a fighting game in LibGDX with a static board, camera moves only right<>left.
There are 5 screen aspect ratios in Android and Apple so I have created 5 different background graphics:
...
2
votes
1answer
45 views
How can a player exist at a location that is not expressly defined?
How do video games like Minecraft know how to place characters on an infinitely complex plane? For example, the game knows the character's place up to 10 or more decimal places and can display them at ...
0
votes
0answers
21 views
Coordinate code for moving the object from one side to others side
I'm trying to make a 2D games, like airplane in android. To play the airplane, the user must shake the phone and then the airplane will move from left side to right side. And I don't know how to move ...
0
votes
1answer
33 views
Unity 2d square position not lining up with its size
I want to have one square that rests at the Unity 2d coordinates (5,5). Using transform.localScale I make the square be 3 units by 3 units large. So I thought that if I made another square that is the ...
0
votes
1answer
58 views
Evaluate 2D point in a 3D triangle?
Given three points,
(x1, y1, z1)
(x2, y2, z2)
(x3, y3, z3)
and given a point "A" at (x, y),
how would I find "A'", at (x, y, z)?
0
votes
1answer
28 views
How to find a point of taking into account the distortion of the projection
I can not find the material that will help me to implement the algorithm of coordinate transformation based on the distortion of the projection.
I am creating a code recognition algorithm (similar to ...
0
votes
1answer
122 views
Project camera-to-pixel ray in world coordinates
I'm trying to implement a very simple ray tracing function but I have a problem with projecting the camera ray (from camera to pixel) to the world space.
In the screen coordinates have the pixel ...
0
votes
2answers
341 views
How to use the SDL viewport properly?
I'm very confused about the SDL2 viewport, I did some googling to find out how to implement it but people keep mentioning things like "world coordinates" which I don't have in my game.
Question : Do ...
0
votes
1answer
63 views
Position of an object relative to another in a 2D plane
I have two objects, A and B, each of them has a set of coordinates (x,y). How do I understand where is A in relation to B's position?
If I where to just check each coordinates I could do it like this:...
-2
votes
0answers
60 views
Motion related databasing with SVG and SQL [closed]
In my game I have two elements moving towards each other, meeting in the middle of the screen. Something like this: (the image will be two slowly converging mouth-like objects, but it's not finished ...
1
vote
0answers
60 views
Pixel Perfect Texture Sampling
Right now I am using the following two shaders to render a sprite from a texture used as a sprite atlas onto a canvas that has canvas_size pixels in screen coordinates.
I use a static quad as input ...
1
vote
1answer
101 views
Vertically mirroring the screen in LibGDX
I'm developing a game in which the screen layout is different for right and lefty players, so i'll put a button in it to mirror the screen vertically.
For displaying textures and fonts, i use a ...
0
votes
0answers
67 views
glOrtho and VBO
I'm trying to send triangles to OpenGL using screen coordinates. Using the deprecated glBegin and glEnd I could just set up an orthographic projection and use screen-space coordinates as the triangles/...
1
vote
1answer
116 views
Coordinate system for a strategy game
I am working on a personal project of developing a simple 3D strategy game. I am working on my own game engine (let's assume that I have to have my own) and I have one theoretical question. How to ...
0
votes
0answers
335 views
Converting Transformation Matrices from OpenCV to Unity
I am working on an AR project, which uses OpenCV and Unity 3D. OpenCV uses Right Handed Coordinate system (different from OpenGL, because OpenCV camera looks along positive Z axis), while Unity has ...
3
votes
1answer
218 views
LibGDX Overlay Game with Stage
I have been working on a 2d game that is similar to billiards/pool. I've got the basic game down and now I'm working on some visual effects. One of the things I would like to do is have have numbers ...
1
vote
2answers
92 views
How define coordinates for bodies in outer space
What is a simple way of representing celestial bodies in outer space using a coordinate system? There are actual scientific coordinate systems (see https://en.wikipedia.org/wiki/...
1
vote
1answer
145 views
Converting normalized device coordinates to world space coordinates flipping my sprites
I'm trying to convert my game's camera system to use world space coordinates rather than OpenGL's default normalized device coordinates, however in doing so my sprites are being rendered improperly as ...
9
votes
3answers
367 views
BRDF and Spherical coordinate in ray tracing
I developed a ray tracer that use standard phong/blinn phong lighting model. Now I'm modifying it to support physically based rendering, so I'm implementing various BRDF models. At the moment I'm ...
2
votes
1answer
67 views
How to change XNA coordinates directions?
Usually XNA increases X coordinate to right and Y to down. Like this:
But in my project i have 2D map. Drawing tile with bigger Y coodinate below OX looking strange (usually people imagines these ...
1
vote
1answer
29 views
Is it necessary to use texture filtering if I use texture coordinate system?
I have one question about using texture filtering.
It's clear when I used normalized texuture coordinates (in any API) for example from (0,0) to (1,1) it is necessary to use texture filtering because ...
7
votes
1answer
195 views
Get local coords from global coords
I need to get local coords from global coords. I did not find ready-made examples.
Please help me how to do it on the example image. Thank you!
UPDATED:
Here's the method in the java, created ...
1
vote
0answers
41 views
Explanation of the parameters in the line intersection code
I am trying to understand a C code that moves the mesh nodes for each time step and i am totally struck on the parameters t1 and t2 please help me sorting this out.
So here is what the function gets (...
1
vote
1answer
264 views
Anchoring a sprite to a specific x & y on another, regardless of rotation [Gamemaker]
I have a sprite, sDetritus, with a corresponding object, oDetritus, and an sTurret and oTurret.
If I apply no rotation (i.e. changing the image_angle) to oDetritus, I can anchor the oTurret to a ...
1
vote
1answer
792 views
Finding relative x and y value on a sprite [Gamemaker]
I'm having a little conundrum that may just result from a lack of knowledge of Gamemaker's functionality. I've attached two images to aid explanation.
I have a sprite of a turret (with a gun barrel), ...
5
votes
3answers
1k views
Is a custom coordinate system possible in Unity
Is it possible to create a custom coordinate system (i.e the one using double for coordinates or the one dividing the world into 'chunks' of safe size) not constrained by the floating point precision ...
6
votes
3answers
867 views
Overcoming float limitations for planet-sized worlds in Unity
As far as I know, going further than 1M units from the world origin in Unity is hardly possible due to floating point precision issues.
Making a world more than 1M units in radius would require ...
1
vote
0answers
177 views
Getting screen coordinates of actor
I'm trying to tell if an actor exists at a screen position so I can do something if the actor is clicked on. To do this, I first need to get the screen coordinates of the actor so I can compare it to ...
1
vote
0answers
24 views
Proper way to wrap sprite for Z dimension
I am using SFML, but I need to add some emulation of 3D by wrapping the sprite with a Z component. When sprites are drawed (or when objects moved?), their X and Y will change depending on Z.
My ...
1
vote
1answer
84 views
Find x and y position with angles in 3D world
I'm actually creating a Tracking Camera (or 3rd person camera), and to do so, I used two angles (X and Y) for the rotation of the camera and an other floating value for the distance between the target ...
1
vote
0answers
315 views
Matrix transform from one coordinate system to another
I have been beating my head against the wall for weeks on this and it is time I just break down and ask for help.
I need to move a 3D camera from an in house system into Unreal 4. The two use ...