# Tagged Questions

29 views

### X, Y, Z rotation around camera

I'm making a 3d orthogonal-projected, game using painters' algorithm in java. I'm able to rotate the objects with incremental rotations (e.g. rotate all objects 10 degrees) using affine ...
27 views

### Camera rotation issue Libgdx

I have a OrthographicCamera and I want to rotate 90° it, but when I rotate it seems to be shifted more to the right. Before rotation: http://postimg.org/image/tc9jpq9zr/ After ...
95 views

### Accurate sprite rotation with mouse movement

I am using the current mouse position to aim the player sprite, but I am not getting the best results. It will often by off by a noticeable amount, or even a complete ~180 off if I go from one side, ...
168 views

### Libgdx Do a fixed rotation for orthographic camera

Im trying to rotate my orthographic camera in the render loop to a fixed angle, but I can only make the camera spin with the code I got: in the create OrthographicCamera camera = new ...
422 views

### How to rotate a set of points on z = 0 plane in 3-D, preserving pairwise distances?

I have a set of points double n[] on the plane z = 0. And I have another set of points double[] m on the plane ax + by + cz + d = 0. Length of n is equal to length of m. Also, euclidean distance ...
137 views

### Bullets won't shoot out of barrel in top-down shooter

So I am working on a top down shoot and have been stumped on why my bullets refuse to come out of the barrel of the gun. I know about the rotation equation which is x2 = x * cos(theta) - y * ...
225 views

### Matrix rotation wrong orientation LibGDX

I'm having a problem with matrix rotation in libgdx. I rotate it using the method matrix.rotate(Vector3 axis, float angle) but the rotation happens in the model orientation and I need it happens in ...
101 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 ...
231 views

### How do I make a cube move by rolling?

I am learning jMonkeyEngine by making some small games with it. I have a simple rectangular cube that I want the player to be able to roll around the game world. When he presses the arrow keys, the ...
102 views

### LWJGL Rotating is moving

I am trying to rotate my QUAD even just a little bit. I have read pages like http://www.java-gaming.org/topics/lwjgl-tutorial-series-moving-and-rotating-triangle/30679/view.html In my render() ...
52 views

### How should I model rotation caused by bounce friction? [duplicate]

In my Java2D simulation, I have a disc which, when it bounces off the boundary of a 2D region, begins to rotate, as if it had gotten some spin from the wall. I'm having trouble relating the ...
380 views

### LWJGL Camera Rotation Issues

I am quite new to LWJGL and OpenGL and I am trying to create an FPS camera. I had no problem with 2D stuff, so I decided to step things up and try and make some things in 3D. I have this 3D camera ...
35 views

### Bounding box should rotate - Skews instead [duplicate]

I have a method to rotate a sprite's bounding box around the center of the sprite (the sprite rotates and I need the bounding box to rotate with it. The sprite is rectangular). Instead of being ...
431 views

### How to set speed of circular motion

Edit 2 - clarification Just to clarify, the issue I have at the moment is how I specify a time (in seconds) for a complete revolution to occur. My delta is fixed and is 1/ticks per second (1/60). ...
241 views

### What are the semantics of glRotate and glTranslate's parameters?

I have been trying to play with OpenGL after watching some tutorials and I don't understand how the glTranslatef and glRotatef functions work. I believe a simple picture would help me. I understand ...
1k views

### Rotate image around a specified origin

I'm trying to rotate my Turret.png (small Gunhead with a laser in front) towards the mouses location on the screen. I tried just using my method for rotating projectiles towards the next step on their ...
424 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 += ...
178 views

### get the new vertices after rotating in JOGL

I had rotate an object with openGL (JOGL). Is there a simply way how I can get the new vertices?
269 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 ...
958 views

### How to I rotate a triangle by dragging the mouse in libGDX?

More specifically, I have rotation working in a way I don't like as follows: //Draw the triangle using this draw method //batch.draw(texture, x, y, ...
405 views

### First Person Shooter vertical mouse aim

I've just started writing a 3D First Person Shooter in Java, and I'm having a bit of trouble with tracking the mouse movements and moving the camera accordingly. I'm implementing typical FPS movement, ...
1k views

### Render rotated rectangle inside other rectangle bounds using Libgdx

I have this code to generate a red rectangle inside a grey rectangle: new Rectangle(grey_rectangle_position_x, Game.SCREEN_HEIGHT/2-Rectangle.height/2,0); This code makes the following: Now, I ...
878 views

### Rotating 3d plane to XY plane

I have a triangle in 3d space and would like to create a grid over the triangle, such as in the image below. The purpose of this is to store information about each block of the grid. In order to ...
123 views

### Pitch (X-axis) rotation problem [closed]

Situation: From a first person perspective (camera position) I want to be able to grab an object and have it fixed to the center center of the screen while looking up-down (pitch) and looking ...
487 views

### Rotation of viewplatform in Java3D

I have just started with Java3D programming. I thought I had built up some basic intuition about how the scene graph works, but something that should work, does not work. I made a simple program for ...
377 views

### Rotating a cube using jBullet collisions

How would one go about rotating/flipping a cube with the physics of jBullet? Here is my Draw method for my cube object: public void Draw() { // center point posX, posY, posZ float ...
1k views

### rotate sprite and shooting bullets from the end of a cannon [duplicate]

Possible Duplicate: How to Align Gun with Bullets Hi all i have a problem in my Andengine code, I need , when I touch the screen, shoot a bullet from the cannon (in the same direction of ...
539 views

### OpenGL Get Rotated X and Y of quad

I am developing a game in 2D using LWJGL library. So far I have a rotating box. I have done basic Rectangle collision, but it doesn't work for rotated rectangles. Does OpenGL have a function that ...
430 views

### How to I get a rotated sprite to move left or right?

Using Java/Slick 2D, I'm using the mouse to rotate a sprite on the screen and the directional keys (in this case, WASD) to move the spite. Forwards and backwards is easy, just position += ...
567 views

### Can't get sprite to rotate correctly? [closed]

I'm attempting to play with graphics using Java/Slick 2d. I'm trying to get my sprite to rotate to wherever the mouse is on the screen and then move accordingly. I figured the best way to do this was ...
5k views

### How can I move a sprite in the direction it is facing?

I'm using Java/Slick 2D. I'm trying to use the mouse to rotate the sprite and the arrow keys to move the sprite. I can get the sprite to rotate no problem, but I cannot get it to move in the direction ...
2k views

### How do I make an entity move in a direction?

I have an Entity instance which is updated every game tick. Let's just assume that entity moves forward constantly. I'd like to be able to give the entity's angle to a function that makes it move in ...
2k views

### Vector movement in space type game (Mouse rotation)

I'm having an issue with my movement in my 'game' prototype. It's basically not working and admittedly my knowledge with vectors is lacking. The issue I'm running into is that the ship won't move in ...
1k views

### How to Align Gun with Bullets

I have a top-down 2D shooter. I have an image of a player holding a gun, that rotates to face the mouse. Please note that the gun isn't a separate image tethered to the player, but rather part of the ...
2k views

### Moving an image by rotating and increasing y axis causes a trailing issue

Forgive me if me anything is unclear, this is a tricky thing for me to explain. In an applet I draw a little ship gif. I have it so I can rotate the object and then increase or decrease the y axis to ...
3k views

### Rotation of images in Slick2D

I have have a rotation problem in the Slick2d library, the image is just not rotating (ie I set a rotation but no result is shown). Here is the rotation code: if (input.IsKeyDown(Input.KEY_LEFT)) { ...
435 views

### Rotate an existing quaternion around an axis?

I have an existing quaternion (Java Quat4f). I would like to rotate this quaternion around an axis (i.e. 90 degrees around the x axis, 25 degrees around the y axis, 10 degrees around the z axis, 180 ...