# Tagged Questions

130 views

### How do I avoid interpolation artefacts when scaling up a heightmap?

I am using a bicubic interpolation algorithm in order to upscale a height map, and I am noticing some artifacts around the pixels boundaries. However, these artifacts don't seem to appear when I use a ...
162 views

### Box2d making a body follow the mouse accurately

I am trying to make a box2d b2Body follow my mouse position. This is the code I am using at the moment but it is not performing very well: deltaPos = mousePos - body->GetPosition(); deltaPos *= k; ...
164 views

### Use quaterions to move the camera direction according to mouse movement

I am trying to use quaterions to move the camera direction vector in the following way. This code is perfectly working glm::quat temp1 = glm::normalize( glm::quat((GLfloat)( ...
271 views

### Shooting many bullets toward the mouse position

I try to shoot a bullet toward the mouse position by this code. float deltaX = mousePosition.x - (aircraft.getPosition().x + aircraft.getLocalBounds().width / 2); float deltaY = mousePosition.y - ...
164 views

### Issues calculating frame independent movement

I'm developing a Breakout style game in C++ using SDL. The problem so far is that the ball slows down and speeds up for no particular reason. The slowdowns usually last a few seconds. EDIT : When ...
136 views

### Rotate a point in 3D space with sine and cosine

I got my camera controlled by the mouse. Now I want a sphere to be always in the center of my view(just for testing). I tried that by assigning the sine of the Y rotation of the camera times 10 as the ...
179 views

### Space Strategy Ship Movement Math

This is similar to a question I asked a while ago, but I phrased it so terribly so might as well start over. I am trying to implement ship movement in 3D space, but confined to a 2D plane at y=0 (see ...
147 views

### Trying to convert as3 Matrix to C++ glm matrix

I am trying to convert a library called DragonBones to C++ Opengl which allows you to use Flash based skeletal animation. I'm almost done but I am running into a problem. I am trying to transform the ...
386 views

### Calculate object coordinates from window coordinates using inverse projection matrix

What I am trying to to is placing 3D Objects (A Sphere) in the world when I click there. I am using a perspective projection so the first step after calculating the canonical clip coordinates from ...
214 views

### Directional light and matrix issues

I'm trying to implement basic directional lightning in OpenGL 3.3 by emulating the logic shown in this guide: http://www.arcsynthesis.org/gltut/Illumination/Tutorial%2009.html I do not understand ...
193 views

### games logic based on closed shapes

I would like to know the math concepts behind shape based games like http://www.miniclip.com/games/fat-slice/en/ To be specific, I would like to know on how to model shapes programmatically finding ...
362 views

### Defining an OpenGL unit

I have read that you can define your OpenGL unit by using glViewport. As far as I understood if you use something like glViewport(0,0,600,600) then 1 OpenGL unit = 600 pixels. Now my problem is what ...
220 views

### Get intersected volume of two planes in 3D

I'm working on AABB - AABB collision response and I'm having trouble figuring one part out. My situation is as follows (see image). I have a player AABB (blue) and an object which collides (brown). ...
182 views

### Jump function of player [duplicate]

I'm developing game in marmalade sdk in c++. I have player in the area.and I wanna make him jump when i pressed a button.When I use this player.moveUp(5px); it just go up 5px, but he has to fall down ...
603 views

### Bezier curve not drawn correctly

I'm trying to draw a bezier curve using 3 points. If I use the quadratic form: I get this result: And I believe it's correct. Now since I need to draw it with a variable number of points, ...
291 views

### Min/Max of two vectors?

This seems like a simple question, but i'm having trouble searching the internet for it. In XNA, during a collision detecting method, I would determin the minimum of some vectors. // Get the minimum ...
633 views

### Spherical to Cartesian Coordinates

Well I'm reading the Frank's Luna DirectX10 book and, while I'm trying to understand the first demo, I found something that's not very clear at least for me. In the updateScene method, when I press A, ...
162 views

### Determining a point that reached another point

I have two points, one is moving and one is stationary. I would like to know if the moving point has reached that point or not. I tried to calculate the distance between two vectors and the distance ...
221 views

### Billboarding + aligning with velocity direction

I'm working on a particle system where I'm orientating the billboard using the inverted orientation matrix of my camera. This works quite well and my quad are rotated correctly towards the camera. ...
209 views

### Getting Center and Radius of Irregural Object

I have drawn an asteroid object manually , and would like to get its center/radius by a specific equation. I think I can get them by calculated and hard-coded values. The code to draw the asteroid: ...
382 views

### Explaining Asteroids Movement code

I'm writing an Asteroids Atari clone, and I want to figure out how the AI for the asteroids is done. I have came across that piece of code, but I can't get what it does 100% if ...
62 views

### obb vs obb and resolve/response for 2d space game [duplicate]

Possible Duplicate: OBB vs OBB Collision Detection How can i detect if an rotated obb intersects another rotated obb and resolve it so both obb objects dont go further into each other. I ...
268 views

### Why is std::atan2 returning -0.0?

Really? Negative zero?! double Vector2D::GetFacingAngle(const Vector2D& target, const Vector2D& source) { a2de::Vector2D facingVec(Vector2D(source) - Vector2D(target)); //Negating ...
483 views

### Rotating an object smoothly

I'm trying to rotate a ship in an asteroid game. What I'm doing is creating a float angle variable and at each time I press left or right buttons, I increase and decrease it, and in the drawing ...
369 views

### Aligning bullet's position in Asteroid Game

I'm writing an asteroid game and I would like to align the bullets on the ship's tip. I also want when the ship fires, the bullet gets the same orientation(angle, direction) of the ship and also be ...
651 views

### Create acceleration with direction

I want to move my object with an acceleration in the proper direction. I'm not good at math so I need some help. The example in Game Maker is: friction = 0.3; direction = 180; speed = 5; But I'm ...
679 views

### Rotating a polygon around it's center

I have drawn a ship using three lines, and would like to rotate the ship around its axis in opengl, I have tried the following, but the ship translates while rotation!. void Ship::Draw( ) { ...
179 views

### Camera not working

I made a camera in DX9. To move forward I press the Up arrow. To rotate on the Y axis I use the mouse. When I perform these movements on their own the camera moves at the speed I want. However, if I ...
637 views

### Is it possible to billboard a sprite using a transformation matrix?

None of the current topics on billboarding seemed to answer this question. But, given a sprite (or quad) that has it's own 4x4 transformation matrix a camera with a view matrix (a standard 4x4 ...
364 views

### Camera target point based on angles

I'm working on a test project to learn some basic OpenGL. Right now I'm trying to work on a "camera" with gluLookAt. My camera object is really simple, I have two vectors, one for the position and the ...
342 views

### Rotating points on a circle

I have drawn a 2D circle in X,Y,Z. I wanted to draw something on specific vertices of that circle and I managed to do it. When I wanted to move the circle, I wanted the vertices to get the updated ...
739 views

### Camera Rotation (for mouse look) with LookAt does not work as expected (Local/Global)

My code for rotating my 3D fps camera isn't working as expected. I expect that the X-axis does rotate with the Y-axis, but it ain't so. I made some pictures to explain it better, I think its doing ...
196 views

### How to make sure that a Point A moving in the direction V reaches at Point B?

Let say I have, Point A(X1,Y1) moving in the direction V(W, H). I need to make sure that it reaches B(X2,Y2). I think I need to subtract some value in Point A(X1, X2). But not know what? I also sure ...
173 views

### Calculate the direction, From Outer Polygon Point to Inner Polygon inside Point

I was able to find the co-ordinates of inner Polygon using this trick. Need the co-ordinates of innerPolygon But, I have some problem in getting the direction from Outer Polygon Point to Inner ...
89 views

### Need the co-ordinates of innerPolygon

Let say I have this diagram, Given that i have all the co-ordinates of outer polygon and the distance between inner and outer polygon is d is also given. How to calculate the inner polygon ...
1k views

### I am looking to create realistic car movement using vectors

I have goggled how to do this and found this http://www.helixsoft.nl/articles/circle/sincos.htm I have had a go at it but most of the functions that were showed didn't work I just got errors because ...
1k views

### Random Vector within a cone [duplicate]

I'm looking to create a random vector within a cone given the radius (base). It feels like I've been traversing through many pages on the internet and still I'm no further forward to getting an ...
1k views

### How do I find the angle required to point to another object?

I am making an air combat game, where you can fly a ship in a 3D space. There is an opponent that flies around as well. When the opponent is not on screen, I want to display an arrow pointing in the ...
350 views

### How do I approach this collision model?

This is the game level prototype I have already implemented. It has few objects per room to allow me to finally add some collision detection/response code into it. VIDEO As you can probably see, ...
760 views

### AABB - AABB Collision, which face do I hit?

To allow my objects to slide when they collide, I need to : Know which face of the AABB they collide with. Calculate the normal to that face. Return the normal and calculate the impulse that to ...
410 views

### 3D Translation using only distance and angles

So I'm starting to foray into 3D game programming, but I've hit something of a snag. I have an object I want to move around. It should always move either forward or backward relative to its local Z ...
2k views

### How do I shoot bullets towards the mouse in a top down shooter?

I have a formula for pointing my main character of the game towards the mouse, and it gets the angle he needs to be turned to point towards the mouse. But how do I get the bullets from the gun to use ...
1k views

### simplest way of making a sphere roll in a realistic way

rather than just moving a sphere across a plane, I want to make it roll like a ball. What is the simplest way of doing this? I assume it will have something to do with the circumference of the ball ...
327 views

### Should SIMD be used by people who are new to game development?

I have been learning game development, using C++ and OpenGL, for about 4-5 months. Before that I used to program in C# and the .NET platform(about a year). So, I consider myself new to game ...
301 views

### What should be taken into consideration when choosing a math library for games?

I'm currently selecting a C++ math library to use for a project. There are several questions here and on SO concerning the 'best' library available and many answers with different suggestions, but I ...
306 views

### How do I build a matrix to translate one set of points to another?

I've got 3 points in space that define a triangle. I've also got a vertex buffer made up of three vertices, that also represent a triangle that I will refer to as a "model". How can I can I find the ...
2k views

### Circle-Line Collision Detection Problem

I am currently developing a breakout clone and I have hit a roadblock in getting collision detection between a ball (circle) and a brick (convex polygon) working correctly. I am using a Circle-Line ...
123 views

### Can i tell if a Vertex Tree is a solid shape?

if a Vertex looks like this: struct vertex { vec3 point; vertex [] connected; }; Can I tell if this makes a solid shape with no holes? (e.g a sphere or a cube, NOT a sphere with a side ...