Tag Info

Hot answers tagged


One way would be to generate tangents of a certain length and use them as coordinates to generate a triangle list. So if the red dots are your points. You make a line to join the points ( in white ) and then generate a tangent to the white line ( in green ) of a defined length. You can then use the endpoints of the tangents to create a triangle list. It ...


window.addEventListener("mousemove", function(e) { mouse.x = e.offsetX || e.layerX; //refers to x relative to canvas mouse.y = e.offsetY || e.layerY; // y relative to canvas // update for click here - it is should not be done each frame });


This should be similar to all movement in that it can be described by location, a point, and velocity, a vector. It is reasonable to assume that the flight takes a predetermined amount of time in seconds or ticks. You can calculate the velocity based on the distance and time of flight. Unfortunately this exchange does not have latex implemented so this might ...

Only top voted, non community-wiki answers of a minimum length are eligible