Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Questions relating to creating a teather object for a video game.

  1. Mar 14, 2006 #1
    Questions relating to creating a tether/chain/rope type object for a video game.

    Hello! I decided to introduce my project instead of just asking the question. I am working on a project to create an object for a video game. I think the best word for it describing the end goal is to call it a tether. It could also be called a rope, chain, leash, fishing line or whip.
    I intend to mimic the movements of real physics, but duplicating say the physics of what occurs in rope fibers seems like something beyond the scope of this project that would require a supercomputer.
    I am starting by building a basic version of such an object and later the project will get more complex.
    In order to describe and manipulate the object, it is broken into segments.
    The object is currently constructed by equal line segments that don't stretch or compress. Each next line starts from the previous line's end point.

    So say for example that I have 2 equal planks of wood, represented by 2 equal lines connected at a joint at their end points.

    If you swing one plank through the air, the connecting plank will thus be moved, in a circular motion around the joint. The planks movement directions are only along a 2D plain.

    (For example the 2nd plank rotates at a fixed joint with the first so they could be shaped like these text-drawing approximations:





    "[URL [Broken] 0001 - 2 segments.exe"]Click here for an exe file example that has arrows drawn from point to point.[/URL]
    It seems like it behaves like a piece of yarn being slowly dragged on a table. As it is the pieces basically appear to follow the part that pulls them. The next step I'm going to try is to add the concept of an object in motion tending to stay in motion.
    In the example, currently the user only manipulates movement by changing the position of the start of the 1st segment, which is always fixed to the mouse pointer.

    The first question:

    Assume the planks have equal masses (say 1 mass unit) and equal lengths (1 length unit), and the joints have no mass. To simplify, there is no friction, no gravity and no wind resistance, and the two planks have no obstructions (including each other - the planks don't collide with each other and stop) and can rotate in any direction:

    how do you mathematically describe the 1st plank's effect on the movement of the next plank?

    To make it simple I could assume that the origin point of the 1st plank doesn't move. So the joint between the two planks would always be in a circle around the origin point.

    There are 3 key variables of the object which are the 2 variables for each point's location (x,y) at the ends of the lines, and 1 variable for the angle of a line coming from the point angle.

    The start point is (x[0],y[0]).
    The joint point (x[1],y[1]) is found using SIN and COS and a specified length from (x[0],y[0]) at angle[0].
    The next point (x[2],y[2]) is found in the same way using angle[1]

    Then lines are drawn creating the 1st and 2nd segments.
    This will later be repeated further to make more flexible points on the rope.

    So another way to put it is, according to physics, when "swinging a plank", what effect does the movement/angle change of a point (x,y) have on the position of the next point (x[i+1],y[i+1])?

    Another possible way of looking at it is to assume that the joints are where the mass is and the planks have no mass. This might be simpler. Let me know your thoughts on this please.

    I'm going to attempt to solve the problem of keeping objects in motion by using the "composite" movement of a point per unit of time as it's momentum or energy of movement. The point should continue to move with this energy of movement. The energy should be transferred to a circular path from the line's start point.

    Also I am going to try applying the idea that enough energy to move all the points of the object which move is applied to the start point[0] (where the mouse is in the example), and only a portion of it is used by the 1st segment with the remainder being transferred through the first segment into the 2nd segment to move it.

    How correct is this please:
    The wood plank's energy of motion in a unit of time is equal to the plank's mass * the average movement of both it's end points.

    Thank you for your help!
    Last edited by a moderator: May 2, 2017
  2. jcsd
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook

Can you offer guidance or do you also need help?