c# - Lines not behaving as they should -


i making small program simulate somekind piece of string, , want can move middle parts of string , other parts move it, made string out of segments of lines. here's picture of how looks now.

image

as can see, top part of string behaving should, trouble @ making bottom part work, can have this? code using upper part is:

            (int = 0; < segmentscount - 1; i++)          {             stringlines[i].lineendpos = stringlines[i + 1].linestartpos;             stringlines[i].startspeedx = stringlines[i + 1].startspeedx / 1.1f;         } 

it looks problem instead of single loop 0 segmentscount - 1, want 2 loops, each computing positions away point user holding rope. perhaps this:

for (int = 0; < segmentsheld - 1; i++)  {     stringlines[i].lineendpos = stringlines[i + 1].linestartpos;     stringlines[i].startspeedx = stringlines[i + 1].startspeedx / 1.1f; }  (int = segmentcount-1; > segmentheld; i--)  {     stringlines[i].lineendpos = stringlines[i - 1].linestartpos;     stringlines[i].startspeedx = stringlines[i - 1].startspeedx / 1.1f; } 

Comments

Popular posts from this blog

jquery - How can I dynamically add a browser tab? -

node.js - Getting the socket id,user id pair of a logged in user(s) -

keyboard - C++ GetAsyncKeyState alternative -