A mathematical concept that can be used to express position, direction or velocity and which can simplify or outright trivialise spatial problems.
0
votes
2answers
323 views
Collision: Vector class (java)
When handling collision detection / response and you need a Vector class, do you need to create that class yourself or is there a java class you can use?
A vector class should have methods like: ...
0
votes
2answers
434 views
Rotate point by a direction vector
Given a vector, A, which represents a point, and a unit vector, B, which represents the looking direction, how would I rotate A so that B is the axis that's looked down on? Let's say the looking-axis ...
0
votes
3answers
83 views
Keeping raycast on the same level
I want my raycast to end at certain height(red line). But as the game is 3D and the camera rotates I can't use a fixed magnitude. What I thought was a stroke of genius, I figured I'd project the ...
0
votes
1answer
65 views
How to change Vectors due to change in it's dependent Base Vector?
PLOT :
I have been developing a game where the player falls down on Y axis and the camera is a Top-Down view camera. The camera, player (main character in the game) movements etc. have all been ...
0
votes
1answer
89 views
How to Draw texture between 2 Vector3
My scenario:
RTS combat style, 1 unit fires beam on another unit
My problem is i want to draw a flat texture between 2 Vector3 points. I have looked at various Billboarding styles but that doesn't ...
0
votes
1answer
182 views
How can I draw a line rotated some number of degrees away from an original line?
I have a line ahead of my moving object to serve as a raycast and its aligned with the object's movement direction. But I want also some extra lines according to an angle related to the 'head' of the ...
0
votes
4answers
154 views
How much to modify yaw? XNA 4.0 [duplicate]
Heres a picture that explains better than my words can
For rotating an object I'm using quaternions.
CreateFromAxisAngle(vector3.Right,yaw)
Maybe this isn't how I should be doing it but I also ...
0
votes
1answer
144 views
Tilting towards turn direction (for a motorbike)
I have a motorbike which moves along based on a direction vector, I set its forward direction to the direction it's moving.
What I'd like to also do with it is have the motorcycle tilt in the ...
0
votes
1answer
212 views
C++ and SDL Trouble Creating a STL Vector of a Game Object
I am trying to create a Space Invaders clone using C++ and SDL. The problem I am having is in trying to create Waves of Enemies. I am trying to model this by making my Waves a vector of 8 Enemy ...
0
votes
3answers
240 views
How would I successfully split a vector to increase game performance?
Okay so I have a vector for all of the monsters that are spawned in my game. All of these monsters are in a single vector and are "active" according to what zone they are in relative to the player's ...
0
votes
1answer
326 views
Calculate path of laser beam?
Lets say we have a laser beam emitter that has a position and an angle (in a 2D world to simplify things). The laser emitted from that emitter will start at that position, and continue heading in the ...
0
votes
0answers
8 views
How to unbind a sprite in an updating vector? LIBGDX framework
How to unbind an updating vector to a sprite? I am using Libgdx framework. here is my code
public class VectorSample extends GDX_TEST implements InputProcessor {
Texture ball,bullet,guider;
...
0
votes
0answers
33 views
JavaScript “Floats”, or ThreeJS wrong positioning?
I want to learn how to use Vectors with 3D.
Here is a strange Error I have encountered today.
Instead of stopping exactly on the other Cube, I get this:
When I change the IF to (cube.position.y ...
0
votes
0answers
51 views
Uses for vector projection?
My previous question was solved by vector projection. Thus I spent some time studying it (Few helpful links: Interactive projection, short video and a longer video.).
There were plenty of sites that ...
0
votes
1answer
118 views
Character movement relative to cursor position
I want my top-down shooter character to move towards the mouse when pressing the up arrow and strafe relative at right angles to it when pressing the left and right arrow keys.
I can't figure out how ...
0
votes
0answers
40 views
Transform a Screen Delta
I have a delta in screen coordinates that I want to transform to a 3d delta in world space.
The delta is in this case a movement across the (x,y) coordinates in screen space on the near projection ...
0
votes
1answer
88 views
Using NumPy arrays as 2D mathematical vectors?
Right now I'm using lists as position, velocity, and acceleration vectors in my game. Is that a better option than using NumPy's arrays (not the standard library's) as vectors (with float data ...
0
votes
0answers
231 views
C++ Directx 11 D3DXVECTOR3 doesn't allow me to devide it [closed]
If i have a simple vector3 like this:
D3DXVECTOR3 inversevector = D3DXVECTOR3( (pos+lookat_pos));
It works perfect!
But let's say i wanted to multiply it by:
Speed*(float) timeHandler.GetDelta()
...
0
votes
1answer
118 views
Is it safe to cast my 2D points to 3D points for a library which only takes Vector3s?
I need to cast a ray in 2D space for bullet collision detection, but the Ray.Intersects method requires a BoundingBox which uses vector3's not vector2's. My question is should I just ignore the Z ...
0
votes
3answers
227 views
Parent-Child position mathematics
What is the math theory when a child object moves with the parent transform?
I am doing an angle indicator which shows a field of view, which works fantastic when the angle is static. But I cannot ...
0
votes
2answers
248 views
3D Vector “End Point” Calculation for procedural Vector Graphics
Alright, So I need some help with some Vector Math.
I've developing some game Engines that have Procedural Fractal Generation for Some Graphics, such as using Lindenmayer Systems for generating Trees ...
0
votes
0answers
107 views
Vector Class Mutex String Is Missing [closed]
UPDATE After going over all my code, the updating code was pointing to the wrong variable which made it null. It works now, very good may I add, thanks for anyone who took the time.
I have a C++ ...
0
votes
1answer
297 views
vector rotations for branches of a 3d tree
I'm attempting to create a 3d tree procedurally. I'm hoping that someone can check my vector rotation maths, as I'm a bit confused.
I'm using an l-system (a recursive algorithm for generating ...
-1
votes
3answers
301 views
Scale a normalized 2D vector always to the same length
For any normalized 2D vector, except for ( 0, 0 ), how would I scale the vector to always be the same length?
For example:
int length = 10;
vector v = vector( 0.1, 0.5 );
vector v2 = vector( 0.3, ...
-1
votes
4answers
135 views
What is a good starting project to get up to speed with vectors and vector math? [closed]
I have been getting into games programming recently. However, all I have made so far (in order) is Snake, Breakout and Tetris.
I want to take on a bigger project, and some research has led me to ...
-1
votes
1answer
91 views
Optimization of Storage of Spells a Character Knows
I need to store which spells a character knows. While the game is executing I have them stored in a vector. Obviously storing this many values is either going to take a lot of computing to get the ...
-1
votes
2answers
171 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 ...
-1
votes
1answer
139 views
Find a Rectangle by coordinates - XNA
I have 2 coordinates (X,Y). I have also a 10x10 array. By these coordinates I have to find the rectangle in which is my pointer at the moment.
How could I handle it?
-1
votes
1answer
224 views
std::vector::size with glDrawElements crashes?
( win32 / OpenGL 3.3 / GLSL 330 )
I decided after a long time of trying to do a graphical user interface using just opengl graphics to go back to a gui toolkit and so in the process have had to port ...
-1
votes
0answers
67 views
Vector2 class design decisions
I'm designing my framework and i was wondering about what features would people appreciate to see in Vector2 class and also i wanted to ask you what design decisions would you like to see there.
...
-2
votes
2answers
299 views
Calc direction vector based on destination vector and distance from enemy in AS3
I'm working on a zombie game in AS3 where I want a character to be able to move away from a zombie depending upon how close the zombie is. The character also has a destination that it's trying to get ...
-2
votes
1answer
426 views
Using Vectors for 2d animation [closed]
I've decided that it's best to start using vectors in my games instead of the
xPos += xSpeed and yPos += ySpeed approach.
I'm posting some of the code from my basic model class which handles movement ...
-4
votes
2answers
157 views
enemy shooting towards FPS [closed]
WELL first of all I want you to see my game (its deployed on heroku cloud) :
http://still-escarpment-3701.herokuapp.com
(It takes almost 10 sec to load so please wait for couple of sec)
I have ...