A mathematical concept that can be used to express position, direction or velocity and which can simplify or outright trivialise spatial problems.
1
vote
1answer
32 views
Drawing & transforming matrices upwards
I'm drawing a hierarchy of 3D objects in C# XNA where each objects has a transform that holds position, rotation and scale.
I get my expected results If I draw my objects from my root node in this ...
-1
votes
1answer
25 views
Changing a direction Vector with Euler angles
It seems like an easy problem but I somehow didnt got to the solution.
I need the Maths to change the Vector based on Euler angles.
Example Problem:
I have an direction Vector- for example: Showing ...
0
votes
1answer
41 views
Clamp point to triangle for sphere collision
I'm having some issues clamping a 3d to barycentric triangle. I've searched for some time now and keep seeing the same results, that (u,v,w) should be clamped between 0 and 1. But when I clamp those ...
1
vote
0answers
26 views
Quaternion question, how to match two quaternions into each other for modular spaceship parts
I am writing a game where you can unlock spaceship parts and piece them together based on predefined sets of connector and requester points.
Each part has a set of connectors and requesters. Both ...
-1
votes
2answers
56 views
Inconsistent speed when using Vector2.Lerp
I have tried to build a point and click mechanism in unity using
Vector2.Lerp(current_position,new_position,Time.deltatime)
But what I observed that the game object is moving at varying speeds ...
1
vote
1answer
42 views
Find the closest point on a ray
I've got a ray defined by P1 and P2, and then a target P3, and I want to find P4. How do I go about this? I've come to understand that I should use vector projection, but I can't get it to work. Any ...
0
votes
1answer
35 views
Roll a 6DOF camera to a plane direction
I've been working on a 6DOF camera that I want to be able to "align" to any walls orientation to make it feel like I'm standing on that wall.
I'm thinking it's a simple matter of finding the right ...
0
votes
0answers
14 views
Adjust Object Velocity depending on Rotation
I am building a vehicle handling line in hyperPad, with no luck.
I have a "gas pedal", and the vehicle.
I can use add, subtract, multiply, divide, mod, get Rotation, get Velocity and set Velocity. ...
3
votes
2answers
182 views
C++ alternative to vector for arbitrary number of objects using pointers
I'm working on a prototype 'life simulation' game which incorporates any number of objects / entities that may exist in the game.
Up until this point I had been working with vectors of the objects, ...
2
votes
3answers
73 views
How can I rotate the camera for a player walking around the surface of a sphere? [duplicate]
I'm making a 3D game where the player can walk across the surface of a planet.
I am having a problem correctly rotating the camera's frame of reference, so that the camera is oriented correctly ...
1
vote
1answer
27 views
Rotation smoothing with Slerp snaps to center when switching between different destination vectors
I'm making a 3D space shooter in Unity (think Star Fox). The ship, when I move it around the map, should rotate slightly (smoothly) in the direction I'm controlling it.
I have smoothness mostly ...
0
votes
1answer
38 views
How to place text centered on the player? XNA
As I can make a text of the size of this, it is centered taking reference of the player?
Right now the following happens:
I want:
code:
spriteBatch.DrawString(Font, player.Name, new Vector2(player....
1
vote
1answer
25 views
How to calcolate moving vector of object by its rotation degress in 2d
i have object in game which is rotating when i move my joystick , now i need to calculate its movement vector by its rotation
the object always moving forward and controlled by the joystick , the ...
0
votes
0answers
26 views
Keeping track of space objects: enemies, projectiles, players
I have a Vector called spaceObjects of type SpaceObject that contains all types of SpaceObjects: Heros, Projectiles, and Enemies.
I've added all these to this one Vector because I'm passing it all ...
1
vote
3answers
54 views
Calculate target angle to a certain Vector
I'm developing a 3D game in LWJGL.
I have a player class and a monster class and I need the monster class to chase the player when the player is within a certain distance.
For that I have the monster ...
0
votes
0answers
38 views
How do I normalise vertex normal vector in C#?
I have a binary file format with vertex positions, normals, UVs and weights. It all works fine, except I can't understand how to get vertex normals out of it. V normals are recorded as bytes1 (one ...
1
vote
1answer
49 views
Garry's Mod gamemode scripting (lua) - How do I tell if an object is inside a hollow cylinder?
I'm fiddling about with gMod trying to make a gamemode where you have to throw a piece of cake into a cylinder that spawns on the map.
This is the code I'm using to spawn the cylinder:
local ent = ...
0
votes
1answer
42 views
2d animation on html5 canvas using a vector and speed
Im moving a starship from one location to the other. In creating a vector, normalize and magnitude it.
Lets assume my vector looks like this
Vector
x: 156,
y: -90,
m: 180.0000000546,
...
0
votes
1answer
17 views
Lengthen Line (bidirectional) - crossing zero line
I'm trying to lengthen a line, by a certain amount.
I want to apply the modification to both points on the line, expanding it in both directions. without moving it from it's current position (center ...
1
vote
1answer
29 views
Pitch/Yaw in circle causes undesired Tilt [duplicate]
I've made my own Camera object, with a forward vector as well as a up vector. I happen to be programming in Android using OpenGL ES 2.0 but I think this question is relevant to all frameworks, it ...
0
votes
1answer
28 views
MonoGame - scale down a sprite from the middle
I want to animate a texture's scale. First it's scaled up to 10, and then it gradually goes down to 1. However the texture is drawn at Vector2(0, 0) so it doesn't animate as I had imagined it would - ...
1
vote
1answer
71 views
LibGDX: How to make something like vector rotation sensor with accelerometer and compass values?
So I've tried the vector rotation sensor using the Android API and it works perfectly to do what I want, but LibGDX does not support this sensor. I've been searching and it seems like I can do the ...
0
votes
2answers
63 views
Unity3D: Find Raycasthit direction
I'm trying to make a Billiard game and I wanna calculate the direction on which the Cue Ball(white ball) will be moving after it hits another ball.
As you can see I wanna calculate the angle/...
0
votes
0answers
19 views
Javascript applying thrust to my inertia
I'm using http://www.mathguide.com/lessons2/Vectors.html#combining as a reference. Their magnitude values are too large for my pixels so I'm decreasing by a factor of 100 - so the 30 magnitude becomes ...
1
vote
1answer
52 views
Computing how fast a vector should go toward certain direction
I have two object in space, one has velocity (object A) with fixed magnitude, and one is static (object B).
every timestep, I add to object A's velocity a vector which direction is object A to object ...
1
vote
1answer
67 views
Clamp camera view angles relative to moving object
I have a camera attached to an entity that moves in a circular pattern around a fixed center position. I am attempting to clamp the rotation of the camera such that it can only look inward toward the ...
0
votes
1answer
53 views
Change sprite angle on sloping ground
I have a problem here with GameMaker built-in physics environment.My player is designed to be on a skateboard. I want my player to rotate its sprite, according to the kind of fixture(up or down slopes)...
1
vote
2answers
58 views
Move to specified coords - libgdx and java
So I am making my bullets go to a point and travel further. Only its acting really really weird. Its like its thinking that the 0,0 location is at the top left instead of the bottom left.
This is the ...
0
votes
1answer
31 views
Turning x and y difference between two points into a projectile moving between them at a fixed speed
In a libgdx project of mine, I have two units on a 2d field who want to fire at each other. They both know the x and y distance to each other by subtracting their enemies position from their own:
...
1
vote
0answers
101 views
Polygon 2D collision response- How do I find the correct edge a polygon hit?
Hey guys I've been seriously stressed out by this, so please go easy on me.
My goal is to reflect a bullet (polygon) off of another polygon, and find the edge the another polygon, A (the bullet), hit....
1
vote
1answer
115 views
How to align a hint arrow to point along a path?
I am using CalculatePath and trying to use path.corners in order to give user a hint for path, that where should he lead next. I am using first two instances of Vector3 of path.corners. Lets call ...
0
votes
0answers
28 views
Vector and aabb collision [duplicate]
Im having trouble with bullet collisions for a 3d game. I've seen many solutions but they either don't work for my case or are way to complicated. Can someone explain in a pretty simple way how to ...
1
vote
0answers
79 views
Moving along the surface of a mesh?
I'm trying to replicate the movement in this game: https://www.youtube.com/watch?v=OcvD8BXars8
The players ship along with all other game elements move along the surface of a mesh.
I've tried ...
0
votes
0answers
50 views
Unity C# - The object of type 'Object' has been destroyed but you are still trying to access it
I have a cube on a plane and I'm tring to move it to certain locations. I've baked the area and added a navmeshagent to the cube. My moving script for the cube looks like this:
using UnityEngine;
...
1
vote
1answer
108 views
Java Distance between two Vector positions never 0
I have a Player moving, but when the player reaching the destination it should stop. But problem is that distance never return 0.
It starts printing this:
0.9672514210000003
End by this and then ...
1
vote
2answers
142 views
Unity Vector3.Angle() direction
I have a space fighter AI. I need to determine how to pitch, yaw and roll the craft to aim at the target.
My current solution:
To obtain the Yaw angle to position the target above the fighter, here ...
3
votes
3answers
110 views
Does AddForce continue to add force indefinitely?
Does the AddForce method continue add velocity to an object forever? Does it need to be limited by another line of code?
Sorry if it is too broad or too simple; I am completely new to programming and ...
0
votes
1answer
172 views
Unwanted roll when rotating camera with pitch and yaw
I have a quaternion class implementation, and when I apply this class to my objects all gone right (rotations), but I have a lot of troubles with the camera. I've been searching a lot trying to solved ...
2
votes
1answer
57 views
2d vector flips during rotation
I have a 2d game (C++ and SDL) and I want the player object rotate to follow the mouse. The player object and the mouse location are both stored in 2d vectors.
In order to have the player's rotation ...
1
vote
0answers
61 views
How to make this vector field animation
This screenshot is from Windows app called MyRadar by ACME AtronOmatic LLC. I found their wind direction animation to be very visually appealing and was wondering if anyone knew how to create this ...
1
vote
1answer
111 views
Shooting Projectiles
I am using cocos2D-x and am trying to achieve the effect of enemies going past and shooting projectiles at the player who is moving around the screen. I am using the code below, which is based on this ...
2
votes
1answer
60 views
Simulating elastic ball collisions quickly escalates to disaster
I'm trying to learn HTML canvas and was working on a basic physical simulation, where a number of balls are drawn and set in motion, and the program simulates them colliding and bouncing off the walls ...
1
vote
1answer
235 views
Getting the Right Vector from the Forward Vector
I'm currently working on a small Camera (ArcBall) and I finally am starting to understand how it will work.
I will first create a basic View Matrix using a LookAt function.
Then, I will send the ...
4
votes
0answers
127 views
Implementing proportional navigation in 3D
Good afternoon guys,
a = N * λ' * V
is the formula for the commanded acceleration required to hit the target,
where N is the proportionality constant, λ' is the change in line of sight and V is ...
0
votes
0answers
38 views
Correcting Vectrosity wire frame line normals
Current Setup
This is my current scene, you can see that as the sphere rotates it looks like at the edges(90 degrees) to our normal you see the lines fine but dead on the almost disappear.
Grid ...
0
votes
2answers
113 views
How do I handle parallel lines when looking for intersections?
I'm using the following method to determine the intersection point of two vector2:
public static Vector2 LineIntersectionPoint(Vector2 startPoint1, Vector2 endPoint1, Vector2 startPoint2, Vector2 ...
0
votes
1answer
38 views
How to rotate a triangle to look at a point?
Lets say I have a triangle defined by 3 vertices and a center point, how do I rotate the triangle so its normal is looking at a specified point?
0
votes
1answer
56 views
Position of an object relative to another in a 2D plane
I have two objects, A and B, each of them has a set of coordinates (x,y). How do I understand where is A in relation to B's position?
If I where to just check each coordinates I could do it like this:...
1
vote
4answers
246 views
Get perpendicular vector from another vector
I should clarify that I understand there is an infinite amount of 'perpendicular' vectors in 3D space. I am creating an electricity effect, and to do this the ability to have any number of ...
3
votes
1answer
108 views
Convert a modified Transform.forward to world space
I am trying to make an electricity system, where it is given the start and end points, and it works out a random sequence of points in the rough direction of the end point. These points are set as ...