Linear algebra is the branch of mathematics concerning vector spaces and linear mappings between such spaces. The tag is generally used for questions regarding calculations over vectors.

learn more… | top users | synonyms (1)

0
votes
1answer
52 views

Convert transform from world to local space

I have a hierarchical node system. Given a world space transform, I need to obtain the transform for a specific node in local space. My Node class has the following method. public void ...
1
vote
1answer
30 views

find Vector2 libgdx

I need to get coorinates of red point. Coordinates are just for example, it would be better to see the common formula. Found code like this, but it gains wrong result.() Vector2 o = new ...
0
votes
0answers
23 views

SDL touch input on Android (3D camera rotations)

I have a question regarding rotating a 3D camera on an Android device using SDL for touch inputs. The desired effect should be when the user touches and moves their finger on the screen the camera ...
0
votes
1answer
65 views

Distance between two lines (textbook answer vs practical application)

I'm reading through "Mathematics for 3D Game Programming, and Computer Graphics" as a refresher, and leading in to some more complex real world problems down the line. However, one of the early ...
0
votes
0answers
17 views

Timed Line Drawing

I'm trying to program a remake of the classic Missile Command Atari game from scratch, but I've run into a problem. So I have a function that can draw a line from one point to another. I figured I ...
1
vote
1answer
67 views

Display mesh in front of camera

Im trying to display a mesh in front of the camera and FACING the camera ( I'm developing an small editor in wpf using helix3d). Pretty much something like this question I load my mesh into a ...
4
votes
1answer
165 views

How do splines work?

I've been beginning to work with different kinds of splines (e.g. Bezier, Hermite, B-splines) in some of my work with computer graphics and I am trying to get a grasp of how they work (mathematically ...
1
vote
0answers
47 views

Is studying Alternate Coordinate System required game development?

I don't know whether or not this question is fit for Gamedev.Stackexchange, but I would like to know :- I am new to Linear Algebra. I only want to study those parts of Linear Algebra which would ...
2
votes
0answers
39 views

What is the most efficient way to determine collision path

I am trying to create a game in which I need to know if two objects will collide in the future, and when. I have both object's position, radius (they are circles) and velocity. A specific example of ...
0
votes
1answer
45 views

In unity, how do I rotate a vector in relation to the player?

I am making a radar script in a unity FPS game project I am making for class. I already have a working example of a radar script that works in relation to the player's position. However the rotation ...
1
vote
1answer
54 views

Tween - keeping a constant velocity at different distances

I am using a tweening library to move my units around. The problem is that the speed varies depending on the distance that the unit has to move because of the tweening: var time = 1000; var tween = ...
1
vote
1answer
29 views

Adjust postion only in X axis

I have two game objects named A and B, just as follows: I want to move object B to this virtual line without any rotation so that the destination is B' . What I have are transformation of object A ...
0
votes
0answers
54 views

Project 2d click/touch onto 3d plane

I have a 3d scene that contains an infinite plane that is NOT parallel to the camera (so every screen coordinate corresponds to a point on this plane- in other words, there are no possible invalid ...
1
vote
0answers
91 views

convert 2d pt into non-affine coordinate system

Say I have a coordinate system that goes from (0,0) to (1,1). We'll call this screen_space. Within this coordinate system, I have 4 points that I would like to define another coordinate system. One ...
0
votes
1answer
57 views

XNA Line to Rectangle Collision return first pixel

I have the following code: public static bool LineIntersectsRect(Point p1, Point p2, Rectangle r) { return LineIntersectsLine(p1, p2, new Point(r.X, r.Y), new Point(r.X + r.Width, ...
3
votes
1answer
83 views

How to calculate height of a thought line over a known spot in 3rd person view?

Assuming a player object with third-person-view is in a 3d room and the center of the screen has a dot - let's call it "cursorTarget". All I have is the position of the player, the position 5 meters ...
1
vote
2answers
500 views

How to find the “up” direction of the view matrix, with GLM

Using OpenGL and the GLM matrix library, I want to translate my camera relative to the world coordinate system. This requires me to compute the necessary view matrix. To initialise the view matrix, I ...
0
votes
0answers
35 views

When use LookAt or Inverted world matrix to compute View Matrix?

I am reading this article http://www.3dgep.com/understanding-the-view-matrix/ and it says that View Matrix is the inverted matrix of World (or Model) Matrix but in the first approach the article ...
3
votes
1answer
57 views

Finding coordinate in radius

Hello i have two points (Vector3) A and B. And have a radius r How can i find a coords of point P in a circle by angle?
-1
votes
2answers
69 views

How to get a pleasant path accelerating to a point

I am having trouble moving an object to a target position with a maximum acceleration limit. If i just accelerate towards the target the object will fly in a doughnut a few times before hitting the ...
-1
votes
1answer
34 views

How to calculate coordinates of ball when collided with a wall?

I'm developing a game like bubble shooter and need to implement bounce of ball off the vertical wall. I have the following inputs: Starting position of bubble: {left: 382, right: 378} Firing angle ...
0
votes
2answers
125 views

How does collisions caculates when developing game in Build an HTML5 Game book

I don't understand authors login when calculating collisions between two circles (bubbles). Here is the Calculating collisions section. Author writes: The bubble being fired follows a set of ...
9
votes
4answers
269 views

How do I correctly project a point behind the camera?

I am making a 3D game in which I put an exclamation marker above points of interest. In order to find out where in the 2D screen should I put my marker, I am manually projecting the 3D point where ...
0
votes
0answers
65 views

How to convert Screen-space translation into World-space translation

private void Translate(SceneMouseMoveEventArgs args) { var camera = args.Camera; origin_screenspace = camera.UnProject(_position).Xy; cursor_screenspace = new ...
1
vote
3answers
168 views

Detect if two objects are going to crash

i am working on a car game where i am to create an AI, in the game there are other cars and a few objects moving around that i do not want to crash with, i have the speed, position and direction of ...
1
vote
1answer
132 views

CGVectorMake to move SKNode at a certain speed towards the middle of screen?

I am trying to launch my ball sprite towards the middle of the screen at the same speed every time I launch it. let vel: CGFloat = 1000 dx = size.width / 2 - ball.position.x dy = vel - size.height / ...
0
votes
0answers
144 views

Basic Line of Sight - Pygame

I'm working on a very basic platformer. All objects are rectangles. I've been looking for a simple way to determine if the line of sight is obstructed between Player and CPU by a platform. I saw ...
1
vote
1answer
51 views

How to figure out a vector based on 2 points that add up to a certain value

I am writing a game in which I am representing a velocity with a vector. I have a starting point and a point that I want the object to move towards at a certain speed. (I need the resulting vector's x ...
1
vote
1answer
242 views

Problem with 2D matrix transform og shapes

I have set myself onto the task of creating a class BaseObject, which represents a graphics object with an associated shape as the member variable shape, which is a pointer an object Polygon. I'll ...
0
votes
1answer
79 views

How to represent ray and line segment in parametric form?(Visibility)

I am trying to implement this algorithm but am not sure how I am supposed to represent my ray and my line segments(walls). For the r_px/r_py do I just use the position of the light? For the ...
8
votes
3answers
2k views

How can I reverse the effect of a transformation matrix?

I have recently been working on a game with using OpenGL and C++ through GLFW. In the game I have an airship with a turret mounted on it. The airship moves around in world space coordinates and the ...
3
votes
2answers
690 views

Mixing Perspective and Orthographic Projections?

I'm going to start with some background, so jump to my question at the bottom for the TLDR version. Problem: In a Japanese 4gamer article (english translation via Chev on Polycount) explaining some ...
0
votes
1answer
54 views

trasformation matrix for model's bones

I was developing an fbx converter for legend of grimrock object model (www.grimrock.net), I just wanted to get the animations cause the rest has been converted by others' tools. I was reading all of ...
4
votes
3answers
1k views

What is a direction vector and why should it be normalized?

I've been trying to get the hang of vectors and I read Wolfire's blog about linear algebra and I seem to understand most stuff except when it comes to storing a direction as a vector and using it by ...
3
votes
2answers
842 views

How to find point on a circle that's opposite another point?

How do I find the coordinate of point and angle value on circle sprite which placed on opposite side of sprite from a touch point and the center point of the sprite? I know A position, B position and ...
1
vote
0answers
318 views

Closest distance from 3D point to vector line

First let's have a look at my little drawing: I have an origin point p1 defined by x, y and z co-ordinates, and a vector v given by x, y and z magnitude. I also have an arbitrary point, p2, given ...
21
votes
3answers
3k views

Are there 3D projections other than orthographic and perspective? [closed]

The question is pretty much in the title. Are there notable 3D projections other than orthographic and perspective that could be used in a 3D system such as OpenGL? In particular, are there any that ...
0
votes
2answers
896 views

How to implement a simple bullet trajectory

I searched and searched and although it's a fair simple question, I don't find the proper answer but general ideas (which I already have). I have a top-down game and I want to implement a gun which ...
0
votes
1answer
64 views

Understanding dot notation

Here's my interpretation of dot notation: a = [2,6] b = [1,4] c = [0,8] a . b . c = (2*6)+(1*4)+(0*8) = 12 + 4 + 0 = 16 What is the significance of 16? Apparently it's a scalar. Am I right in ...
0
votes
0answers
225 views

How to rotate a line in 3d space?

I am trying to figure out direction vectors of the arrowheads of an arrow. Basically I'm given a normalized direction vector (u,v,w) and I need the normalized direction vectors of the its two arrow ...
0
votes
2answers
2k views

How can I get a direction vector from a an Euler angle?

Im trying to get a directional vector from an euler angle. But im not getting how to do it. This is what i got so far. escapeAngle += 90; var radians = escapeAngle * (Mathf.PI / ...
1
vote
2answers
2k views

How can I find the perpendicular to a 2D vector?

I'm making a top down game where the player moves forwards towards the position of the mouse cursor. As part of the player's movement code, I need to determine a vector that is perpendicular to the ...
3
votes
1answer
2k views

Gerstner wave function simplified?

The gerstner wave function is a commonly used method to calculate waves and simulate water in video games and movies or most 3d simulations. It is however quite complex so it is very hard for young ...
2
votes
1answer
648 views

3d Water Simulation formula questions

I have created a Grid: At each point along the grid, is a vertex (Intersection Points): Each of these points has an x,y,z position. Vector3f(x,y,z). In an attempt to animate the grid into a group ...
-1
votes
3answers
2k views

Move player to mouse click

Im hopelessly not good at algebra and such. But im trying to learn. I want to learn and understand how to use it in game programming rather than modifying snippets or using classes that do it for me. ...
2
votes
2answers
296 views

Angle between two planes

I have two triangles in 3d space which share 1 edge and I would like to determine if the angle between their normal vectors is "uphill" or "downhill". In other words, if you set one flat, would the ...
-1
votes
1answer
146 views

Can not seem to adjust the speed of my Car

I'm programming in C++, rendering in OpenGL and using GLM for matrix/vector manipulation and I have implemented very (very) basic car controls; ignoring many forces that are present in reality. Since ...
1
vote
1answer
2k views

Basic Car Movement, Converting 2D Vectors to 3D problems

I'm trying to follow this guys method for steering a basic car. Link. It's the first example I can sort of get my head around and I'm trying to convert it to a working 3D version. To get some scope, ...
0
votes
1answer
109 views

Using versors for movement

The context I was thinking of using a versor + velocity field to implement the "moving" part of a 2D game object. For example, if the player should move right I just set the versor to be: [1, 0] and ...
1
vote
1answer
1k views

shadow mapping and linear depth

I'm implementing ominidirectional shadow mapping for point lights. I want to use a linear depth which will be stored in the color textures (cube map). A program will contain two filtering techniques: ...