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.

learn more… | top users | synonyms

0
votes
0answers
18 views

Where is the center of the mesh when dealing with imported assimp animations?

I imported a scene from a FBX into Unity with assimp but the animations are completely wrong: Unity uses a left-handed coordinate system and I managed to solve this problem by adding the following ...
0
votes
1answer
33 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
15 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
36 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: var campfire = new Image(); campfire.onload = function () { ctx.drawImage(campfire, campfireX, ...
0
votes
1answer
41 views

Converting back and forth between spherical and cartesian coordinates in glsl

I have checked all the possible resources and I still don't know why my code is not working. This code should convert uv (texture coordinates) or cartesian into spherical and back. But my code still ...
0
votes
1answer
51 views

How do I convert positions between local coordinate systems?

Say I have worlds and levels. Each world contains multiple levels. Levels have their own coordinate system, centered around their pivot point (assume its centre, for example). These level coordinates ...
6
votes
2answers
216 views

How can I randomly generate objects inside of a Complex Area?

In my game, I want to generate randomize enemies inside of this green area that I made with a custom editor tool.
-1
votes
1answer
29 views

Coordinate in LibGDX?

Hi i am learning libGDX these days, I followed this example, and I read this wiki I dont really understand these line of code after adding viewport @Override public void resize(int width, int ...
1
vote
2answers
68 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
94 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
1answer
102 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
59 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
37 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
84 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
21 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
26 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
41 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
64 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
40 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
2answers
81 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
112 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
87 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
50 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
108 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
106 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
31 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
103 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
46 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
1answer
35 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
29 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
166 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
528 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
71 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
61 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
79 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
108 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
81 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
135 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 ...
3
votes
1answer
300 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
106 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
165 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
389 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
69 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
31 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
199 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
45 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
363 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
1k 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), ...