2
votes
1answer
21 views

Libgdx : point that scrolls on the edge of a circle

I'm not very familiar with libgdx vectors. I want to create my own joystick-controller and I want to know how can I find the coordinates of B by using Vectors. I can calculate the radius and I have ...
1
vote
1answer
51 views

Scale around a point

I am trying to create an image editing application for the purpose of generating UV maps in my own format. I am currently working on scaling the image for the purpose of zooming. I can get the image ...
-1
votes
3answers
94 views

Shooting based off mouse position [duplicate]

I'm trying to shoot bullets where the mouse is aiming using one image as a test. I'm trying to get the mechanics like this I have some kind of algorithm to handle that but the results arn't too ...
2
votes
1answer
342 views

3D Camera Rotation

Please, forgive me, but I need help and I've been stuck on this for a few weeks now, I'm making no progress and everywhere I go and I see a different answer, everything I try doesn't work. I've had ...
1
vote
1answer
106 views

libgdx get rotated sprite coords points

I would like to get the position of each edge of a sprite when he has been rotated. I have no idea how to do it, I made a image to explain it. I would like to get the X and Y position of each Red ...
0
votes
0answers
65 views

how to do picking in 2d lwjgl

I searched the whole internet, but I couldn't find something useful. How to do picking (like ray picking) in lwjgl in orthographic mode (2d)? I think this is less confusing than picking in 3d, but I ...
0
votes
0answers
48 views

Java Angle Math: Calculate how near the player looks to an entity [duplicate]

I am programming a Minecraft Bukkit plugin and need a way to calculate an input number from 0 to 360 for displaying a custom compass / radar. So if the player directly looks at the object (shouldn't ...
2
votes
4answers
260 views

Implementing frame-independent friction

So I'm not looking for anything realistic like a physics engine, just want to say that first. I'm working on a simple top-down game and I'm trying to get friction working with deltaTime. This was my ...
2
votes
1answer
243 views

Ray picking and bounding boxes in Java

How do I check which bounding boxes (of different types) a ray, sent from the camera through the mouse-click coordinates, intersects with first in Java (and where)? I have arrays (box_X, box_Y, box_Z, ...
0
votes
0answers
40 views

Find angle between two points in java [duplicate]

I am making a very simple game and want the hunter to shoot the dragon when the player touches on the screen. I want the arrow to be craeted at hunterPosition.x and hunterPosition.Y and move towards ...
2
votes
1answer
242 views

Circle to Circle collision - bad accuracy

Circle1 (blue) is moving and its X and Y bounds are the screen (meaning it bounces off the walls). Circle2 (black) is stationary. Circle1(blue) is supposed to bounce off of Circle2 without ...
2
votes
1answer
258 views

Vector normalization gives very imprecise results

When I normalize vectors I receive very strange results. The lengths of the normalized vectors range from 1.0 to almost 1.5. The functions are all written by me, but I just can't find a mistake in my ...
1
vote
1answer
163 views

Calculate when round object is inside an ellipse

I want to calculate in java when a circle is inside an ellipse. I drew an example below: For this particular problem, the top left corner of the field has the position 0.0f, 0.0f. The bottom right ...
3
votes
1answer
127 views

Convert global rotation into local rotation

I have an object in my game and I have its location, rotation and scaling in separate float[3]. The location rotation and scale are all on the global axis; these do not change based on the objects ...
-1
votes
1answer
429 views

Java moving image to where it is facing

I am trying to make an Asteroids type game. I searched and tried everything to move an image along its angle (as radiant). Using my knowledge of trigonometry I made the following calculation: x += ...
2
votes
1answer
275 views

How do I make my camera follow a Box2D object?

I'm implementing a camera in my game. It worked for regular objects, but I began using Box2D and obviously things changed a bit. I have a Body object that I want to draw at the center of the screen. ...
1
vote
1answer
341 views

Making Ball Fling in a Curve Direction

I was wondering how to figuring out how to slice a ball (banana kick) by flinging it curve-ways. However, according to the LibGDX's gesture listener, the method for flinging only focuses on a straight ...
0
votes
2answers
275 views

Is this Rotation Matrix correct?

I'm having heavly troubles with setting up a View Matrix and a Projection Matrix. It simply doesnt work. So I think my problem is related to my rotationMatrix function. I'm using this tutorial to ...
1
vote
2answers
147 views

How do I derive the angular movement for a craft

I have the regular (linear) motion implemented like this: class Craft{ ... Vector location, velocity, acceleration, angularVelocity, angularAcceleration; ... //the move class responsible for linear ...
4
votes
2answers
285 views

Inventory Grid Detection

I'm working on creating an inventory system for a game. The inventory system will use cells and 2D images to represent items, like Minecraft, Diablo, or WoW. I've hit a bit of a snag when trying to ...
0
votes
2answers
942 views

Perspective camera for 2D

I'm very new to LibGDX and I'm trying to use DecalBatch with PerspectiveCamera, simply to have Z-coordinate for my sprites, as SpriteBatch does not offer that. However, I don't know how to calculate ...
11
votes
8answers
2k views

Converting a 2D curve into points for data storage

I’ve created an algorithm which converts any curve i.e. path into minimum number of points so that I can save it into a file or database. The method is simple: it moves three points in equal steps ...
0
votes
1answer
744 views

Please help me with my 2D isometric tile picking [duplicate]

Possible Duplicate: How to convert mouse coordinates to isometric indexes? Okay, I apologise in advance if I make no sense here. Basically, I've got a simple application that takes in a ...
4
votes
1answer
554 views

Drawing isometric walls

I'm having some trouble with isometric walls. I'm drawing isometric floor tiles using the back to front rendering method, and it works fine. I also keep my floor tiles lined up properly in a nice ...
0
votes
1answer
119 views

Find the footprint of an isometric entity

I'm working on making a 2D isometric engine in Java. I'm getting into collision detection and I've hit a bit of a problem. Characters in-game are not restricted to movement from tile to tile - they ...
5
votes
1answer
698 views

Isometric - precise screen coordinates to isometric

I'm trying to translate mouse coords to precise isometric coords (I can already find the tile the mouse is over, but I want it to be more precise). I've tried several different methods but I seem to ...
-2
votes
1answer
221 views

Move projectile in direction the gun is facing [duplicate]

Possible Duplicate: Move sprite in the direction it is facing? I am attempting to have a projectile follow the direction a gun is facing. When using the following code I am unable to make ...
1
vote
1answer
333 views

Point inside Oriented Bounding Box?

I have an OBB2D class based on SAT. This is my point in OBB method: public boolean pointInside(float x, float y) { float newy = (float) (Math.sin(angle) * (y - center.y) + Math.cos(angle) * ...
1
vote
3answers
754 views

(int) Math.floor(x / TILESIZE) or just (int) (x / TILESIZE)

I have a Array that stores my map data and my Tiles are 64X64. Sometimes I need to convert from pixels to units of tiles. So I was doing: int x int y public void myFunction() { getTile((int) ...
2
votes
2answers
150 views

Get all triangles that are < N dist from you?

Does anyone know of a way I could add a radius to this code for p? Like basically saying "this is true if the triangle is < N dist from the point" public boolean isPointInTriangle( Vector3f p, ...
9
votes
3answers
3k views

How to move an object along a circumference of another object?

I am so out of math that it hurts, but for some of you this should be a piece of cake. I want to move an object around another along its ages or circumference on a simple circular path. At the moment ...
-1
votes
1answer
390 views

How do I convert sin, cos and tan into an int in Java?

How would you be able to change Math.sin, Math.cos and Math.tan into an int? This is because I heard that it is useful to have those Math resources in movement, gravity, etc. in gaming. Also, as a ...
0
votes
2answers
1k views

3D: First Person Movement

I've searched and searched for a solution today but haven't found one. I have a Camera with Vector3 and also the camera has an angle. If I use this: hero.position.x += speedX; hero.position.z += ...
0
votes
1answer
192 views

Minimap Around Perimeter of Screen, Code Provided

What I'm essentially trying to do is what a lot of FPS's nowadays do in regards to their HUD. When an objective is off-screen, a small icon / symbol is shown on the perimeter of the screen, basically ...
1
vote
1answer
705 views

Relating a point after an image is panned and zoomed

For Android, let's say you have a image of a map that you draw inside your view. On this map there are many, many "hot spot" locations where you want your user to be able to select. Given that there ...
3
votes
3answers
2k views

Suggest a simple Java math library for matrix operations for use with OpenGL (lwjgl) [closed]

I'm writing an OpenGL app with Java. I need to do some math for camera and frustum culling (for AABB). Could you suggest a simple and fast Java math library for that?
1
vote
3answers
4k views

Find Point with only angle and distance

I'm working on a school project and we have to create a tank team with the programming game Robocode (tank battle with self programmed bots in Java). I have to program a scout bot that scans, finds ...
1
vote
2answers
522 views

OpenGL Camera causes spatial distortion

I'm trying to implement a 3D camera of the "Orbit around the origin" variety in a game engine I'm developing in order to learn about 3D graphics and game programming. I have a basic handle on the ...