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
17 views

How do I generated cubic UV coordinates for a mesh?

I'm trying to add a utility function to my game engine that generates cubic texture coordinates for a specified mesh. I've attempted to come up with my own algorithm but I can't get it to work ...
2
votes
2answers
46 views

How can I represent location in a massive world?

I've been thinking about No Man's Sky a lot recently and all the technical challenges they must face. For example, how on earth do you store a players location in a world that is so enormous? I ...
0
votes
1answer
35 views

Unity3D Get object size in order to be used in Vector3 coordinates

I have a plane in Unity in 3D project, and I want to get its boundaries so I can use them in random function for getting Vector3 coordinates. Currently I am trying like this GameObject ground; void ...
1
vote
0answers
15 views

Error in projecting coordinates from FitViewport to screen in LibGDX

i'm using a FitViewport to render my "game world". Viewport virtual dimensions are fixed 400x240. I use viewport.unproject method to scale input touches from screen coordinates to world coordinates, ...
1
vote
2answers
68 views

What does it actually mean by World, Window and Viewport?

I am studying Computer Graphics myself. I am stuck with the concept of World, Window and View-port. As far as I understood: (1) World - is an abstract and imaginary space that is imagined to exist ...
4
votes
1answer
126 views

How do I convert screen coordinates to isometric tile map coordinates in libGDX using matrices

I know this has been asked many times but my question doesn't quite fit the others. I have an IsometricTiledMap and I need to get the tile under a set of screen X and Y coordinates. Here is a picture ...
-1
votes
1answer
54 views

What is the best way to send/receive data about user coordinates and other properties?

For example If I have 2 users, and each of them have an object, and that object has: x coordinates, y coordinates, angle, state, and other properties... I use java let'say the game changes at 30 ...
1
vote
1answer
70 views

Coordinate System - Movement from A to B

I've got the following code snipped : var distanceFromDestinationSquared = ( Math.pow(this.orders.to.x - this.x, 2) + Math.pow(this.orders.to.y - this.y, 2)); ...
0
votes
0answers
15 views

Screen coordinates to letterboxed view

So I have letter boxing working properly (it's not really important but I'll post that bit of code too), but I'm trying to figure out the point/vector arithmetic for translating (projecting) screen ...
1
vote
1answer
77 views

Isometric Tile Selection with rectangular bounding boxes

I am having problems trying to determine which tile I have selected with the mouse. Currently it selects two tiles, rather than one. Producing the following results: My tiles height, is half their ...
0
votes
1answer
98 views

Easy method of obtaining texture coordinates for sprite sheet

In my (OpenGL ES 2.0 Android) game, I use 2 types of Sprite Sheets. In one type all sprites/frames are of equal size and in the other they are all different shapes and sizes. It is the latter one to ...
1
vote
1answer
74 views

How are CSS and WebGL coordinates related? [closed]

I'd like to build a simple framework which rendering combines web page DOM elements with WebGL, such that they're manipulable in the same coordinate space. How does the plain CSS coordinate system ...
0
votes
0answers
54 views

Coordinate system in OGLdev tutorials

Working with OGLdev tutorials http://ogldev.atspace.co.uk/ I found that this code uses coordinate system, which doesn't look like in most other samples. Positive x-axis direction is left, and not ...
0
votes
0answers
81 views

Pre- or post-multiplication for rotation between coordinate frames

I have three 3D coordinate frames: O, A and B, as shown below. I want to know the rotation matrix RAB between A and B, that is the rotation that is required, with respect to the frame A, to move ...
0
votes
0answers
32 views

Rotating between two coordinate frames

I have two coordinate frames, A and B. I want to create the rotation matrix RAB which takes you from A to B. A is a right-handed system, and B is a left-handed system. Furthermore, after moving from a ...
0
votes
0answers
112 views

How to get a position from a radial distance and angles?

I have a radius and the 2 angles for northSouth and eastWest rotations in degrees. I need a Spherical position or a cartesian position (I have code translate one to the other) Where a position is ...
0
votes
0answers
68 views

Transformations between coordinate systems

In a graphics engine, I have three three-dimensional orthogonal coordinate systems, O, A and B. A and B are the result of two different transformations from O. I now want to calculate the ...
2
votes
2answers
258 views

How can I compute which chunk a coordinate is in?

I am working on a video game. Everything (terrain, entities, particles) is stored in 100 by 100 chunks. Here is the array structure for the chunks: public static final int chunkSize = 100; public ...
0
votes
0answers
69 views

Collision detection in JavaScript Canvas game - Issue with 'if' statements [duplicate]

I am currently developing a simple browser-based game and seem to be on the cusp of collision detection that doesn't just return the player to where they were before, but actually will slide them ...
1
vote
1answer
78 views

“aim at” in 3D space algorithm

I'd to calculate the cartesian rotate values of "aiming" one point at another in 3D space. For example, assuming rotation order of XYZ: Point A is at [0, 0, 0] Point B is at [2, 2, 0] If point A was ...
0
votes
1answer
94 views

Mouse position to grid position not working

I have a function which converts my mouse position to grid position in the game but it is not working properly... its slightly off. I have two functions - one which converts from grid to screen ...
2
votes
1answer
262 views

How to put the game object to the upper left corner of the screen in Unity and make it visible entirely on all screens of mobile devices

I have game object which displays health indicator in my 2d video game in Unity. This gameobject contains a lot of sprites and i put it into left/top corner of the screen. In my game editor it is ...
0
votes
1answer
131 views

Bounding Box not rotating based on draw rotation (Java)

In the process of developing a 2D game and am having some issues with translating coordinates on rotation. The object being rotated is a sword that is attached to the player. The player currently ...
1
vote
1answer
136 views

How do I convert from rectangular to spherical coordinates?

This seems like a fairly basic and common problem. Is there a builtin way to achieve it or do I have to write the algorithm on my own? If I do, how should it work?
0
votes
0answers
38 views

OpenGL: What's the best way to convert a screen coordinate to a world coordinate? [duplicate]

For example, suppose I'm building a first-person shooter and the player pulls the trigger. I want to convert the screen coordinate (x, y) into a world coordinate (x, y, z) to know what they've hit. ...
0
votes
1answer
314 views

How do I get the mouse coordinates relative to my whole scene with Monogame? [duplicate]

I am making a topdown isometric real time game using Monogame. I know how to get the mouse position for my camera view. How do I get the mouse coordinates relative to the entire scene? My game's ...
0
votes
1answer
59 views

How to change the position of a circle in pygame in three stages

I will try to explain it as well as I can excuse me if I'll fail. I have the following simple game situation: I know the coordinates of each point. So each of the green points try to hit the blue ...
3
votes
1answer
98 views

Colision detection of disc (Maximum Material Condition aka “Flatness”)

I have a 3D-laser scanner which gives me a series of points of a real-world object. The points are related by a common origin. I know I can derive the equation of a plane from 3 points and that the ...
20
votes
5answers
4k views

Why is the origin in computer graphics coordinates at the top left?

From what I've seen almost all things use coordinates where (0, 0) is at the top left and the positive Y-axis goes in the downwards direction of your screen. Why is it like this? Why not the ...
0
votes
1answer
188 views

Mouse coordinate conversion Libgdx

I have a camera: //Map is a my object that wrapper of TiledMap class In the create method: this.renderer=new OrthogonalTiledMapRenderer(this.map.getMap(); this.camera=new OrthographicCamera(); ...
2
votes
1answer
129 views

Screen coordinates to isometric coordinates?

I know this has been discussed here before, but I couldn't find an easy solution for my particular problem. I have a tile system and I'd like to convert screen coordinates into isometric tile ...
0
votes
1answer
211 views

Coordinates issue vertical scroll Libgdx

I'm going crazy with this problem. I'll explain: I have a camera that falls down (flowing along the y-axis) which displays a TiledMap and declare the whole in this way: In the create method: ...
1
vote
1answer
363 views

Libgdx 2D Game, Random generated World of random size, how to get mouse coordinates? [closed]

I'm a noob and English is not my mothertongue, so please bear with me! I'm generating a map for a Sidescroller out of a 2D-array. That is, the array holds different values and I create blocks based ...
9
votes
3answers
961 views

How do I translate a spherical coordinate to a Cartesian one?

Could someone point me in the right direction as to how this might be achieved? 3D math / geometry often throws me. I'm looking for something like this (ideally in C#): public Vector3 ...
2
votes
1answer
401 views

Why AnchorPoint doesn't affect `CCLayer` Positioning?

I think there is a difference between CCLayer and CCNode behavior when I change their AnchorPoint. I will describe what I mean and please somebody explain it ? Scenario: I start with CCNode CCNode ...
6
votes
4answers
2k views

How do I convert from the global coordinate space to a local space?

Given an entity named EntityA, I want to define a local coordinate space, where the position of EntityA is the origin, its heading vector is the X axis, and the normal of the heading vector is the Y ...
1
vote
1answer
2k views

Convert Screen coords to World Coords LIBGDX

I'm working on a tile based platformer game in libgdx. I'm having trouble getting the actual touch input coordinates when the aspect ratio of device is different from the virtual fixed aspect ratio ...
2
votes
2answers
166 views

How do I convert screen coordinates to between -1 and 1?

I'm writing a function that allows me to click on my tiles. The origin for my tiles is the center, however, the mouse's origin is the top left. I need a way to transform my mouse coordinates into my ...
2
votes
1answer
126 views

Why are my 2D world click-positions offset after camera movement?

I'm writing a 2D game engine. I need to add a camera to my world that can zoom in and out as well as move away from its initial position at (0,0) at the center of the world. The main issue can be ...
2
votes
1answer
358 views

How to project spherical coordinates to canvas

I have objects with coordinates in a spherical coordinate system (altitude alt and azmiuth az). I want to project those to my canvas with a given size (128 x 128 pixels²) and resolution (about 6 ...
3
votes
2answers
103 views

How can I read the color of a specific pixel in XNA?

I want a way to find out if, for example, the pixel at Vector2(2, 5) on the game window is color Color.Red, or some other color or set of coordinates. How can I do this?
0
votes
1answer
368 views

Could you explain this calculation of tiling and offset?

I don't understand why we add +colNumber when we calculate the offset = Vector2 ((uIndex+colNumber) * size.x, which gives us x=3 for the index 13, which is the square located at the coordinates x:1, ...
1
vote
0answers
123 views

Storing rigid body collision shapes in local or world coordinates

I'm writing the beginnings of a lightweight 2d rigid body engine (in javascript, as a hobby project), and i'm debating whether to store collision shapes in local or in (updated as needed) world ...
2
votes
1answer
3k views

How to match user click and the sprite object position in libGDX framework

I am using libGDX Java framework for developing a practice game in Eclipse. My game is in landscape mode and I am using sprite image for game assets. Actually I am trying to follow the Kilobolt ...
0
votes
1answer
985 views

What are the advantages/disadvantages of using a polar coordinate system in a video game? [closed]

Would it ever be a good idea to represent an object's position as a magnitude at some angle relative to a reference point, instead of the typical x, y, z coordinates? What sort of effect would it ...
0
votes
1answer
228 views

Mismatch cordinate system of unity and android

I am new to unity3d, Right now i am adding a cube as game object with coordinate 0,0,0 But when i run it on android device Iam facing 2 problem a) Coordinate system of unity3d are different from ...
1
vote
1answer
223 views

How do I flip upside down fonts in FTGL [closed]

I just use FTGL to use it in my app. I want to use the version FTBufferFont to render font but it renders in the wrong way. The font(texture?buffer?) is flipped in the wrong axis. I want to use ...
0
votes
0answers
22 views

How do I scale and rotate around different points in Libgdx? [duplicate]

I'm using a SpriteBatcher to rotate and scale a TextureRegion in libGDX. I'd like to rotate the texture around an origin outside of the region, but have the texture scaled around the region's center. ...
3
votes
1answer
208 views

Float-based screen coordinates, higher mouse precision

I wrote 2 weeks ago about problem with motion blur in my engine. When camera moves using keyboard, motion blur is smooth. But when I rotate camera using mouse motion blur is stepping (not sure if I ...
0
votes
2answers
710 views

Texture coordinates for a 3D box

I have a box model in my DirectX application, stored as 8 vertices: MyVertex vertices[] = { { DirectX::XMFLOAT3( - 1.0f, + 1.0f, - 1.0f ), /*,tex coord...*/}, //0 { DirectX::XMFLOAT3( + ...