Jump to content

Roller coaster???


Recommended Posts

Best approach to make something rolling on Spline with provided vex code and file inside some Structure :wub:..Thanx ...FOund some pictures and codes Asia Forums ...HOW??


float theta = atan2(v@N.y, sqrt(v@N.x * v@N.x + v@N.z * v@N.z));
 

float gravity = (9.8 / float(60 * 60)) * -1;
 

f@speed += gravity * sin(theta);
 

float friction = 1;
f@speed *= friction;
 

f@curvePos += f@speed;
 

float curveLength = primintrinsic(1, "measuredperimeter", 0);
 

float ratio = (f@curvePos / curveLength) % 1;
vector2 posuv = set(ratio, 0);
 

@P = primuv(1, "P", 0, posuv);
@N = primuv(1, "N", 0, posuv);
@up = primuv(1, "up", 0, posuv);



 

Roller.hiplc

0211.gif

dgdg.gif

Edited by Librarian
  • Like 4
Link to comment
Share on other sites

  • Librarian changed the title to Roller coaster???

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...