aboy5643a
|
  |
| Joined: 20 Nov 2010 |
| Total Posts: 2785 |
|
|
| 10 Aug 2011 08:48 PM |
This is a Scripters Math Game (and also a way for me to solve my problem!!)
Right now this equation is linear! And a certain someone *cough*Quenty*cough* and his buddies want me to make it quadratic! I have absolutely no clue how to do it though D:
Here are some variables
CFrame = startingpos + (endingpos - startingpos) * (iteration/total_iterations)
How would one go about making this return a quadratic result O.O
~Post here if you're Viet Namese, Canadian or Chinese. I'm from these 3 places. - Some confused kid from Language Center ~ |
|
|
| Report Abuse |
|
|
elucidir
|
  |
| Joined: 08 Aug 2011 |
| Total Posts: 243 |
|
|
| 10 Aug 2011 09:01 PM |
| http://www.roblox.com/Forum/ShowPost.aspx?PostID=47182096 |
|
|
| Report Abuse |
|
|
Roundel
|
  |
| Joined: 20 Mar 2010 |
| Total Posts: 469 |
|
|
| 10 Aug 2011 09:07 PM |
| ^This guy outdoes everyone, wonder who his main is D: |
|
|
| Report Abuse |
|
|
aboy5643a
|
  |
| Joined: 20 Nov 2010 |
| Total Posts: 2785 |
|
|
| 10 Aug 2011 09:14 PM |
Now reading that, I realize Quenty doesn't want quadratic, he wants a Bezier Curve... Great.. I have no idea what that is. To the GOOGLE!!!!!!!
~Post here if you're Viet Namese, Canadian or Chinese. I'm from these 3 places. - Some confused kid from Language Center ~ |
|
|
| Report Abuse |
|
|
Roundel
|
  |
| Joined: 20 Mar 2010 |
| Total Posts: 469 |
|
|
| 10 Aug 2011 09:16 PM |
Bezier curves -> calculus.
You can be cheap and use math.sin() to get a similar effect. |
|
|
| Report Abuse |
|
|
|
| 10 Aug 2011 09:26 PM |
| I made bezier curves on roblox before using equations I found on the internet, so it isn't that hard. Just go to wikipedia. That article is actually helpful. |
|
|
| Report Abuse |
|
|
|
| 10 Aug 2011 09:27 PM |
If something is linear, you can't "make" it anything else without changing the expression, and since you aren't sharing what change you want, no one can help you.
You would just modify the weights, probably, which isn't bezier or whatever if you only have 2 points. |
|
|
| Report Abuse |
|
|
Roundel
|
  |
| Joined: 20 Mar 2010 |
| Total Posts: 469 |
|
|
| 10 Aug 2011 09:38 PM |
CFrame = startingpos + (endingpos - startingpos) * (iteration/total_iterations)*(iteration/total+iterations)*(math.sin(iteration/(total_iterations/2)))
This should be what you're looking for, it's what Team Ivory uses. The variable names were different though so I may have made a typo when I was writing that out (I'm dyslexic) |
|
|
| Report Abuse |
|
|
aboy5643a
|
  |
| Joined: 20 Nov 2010 |
| Total Posts: 2785 |
|
|
| 10 Aug 2011 09:58 PM |
@Roundel
I'm just not finding what I'm looking for with this... I want it to smoothly transition through each point's CFrame and Focus, but I ACTUALLY WANT IT ON THAT POINT. Which doesn't happen with bezier curves... Hmm... I'm thinking I leave it linear. If Quenty and his crew want quadratic, they can figure it out themselves...
~Post here if you're Viet Namese, Canadian or Chinese. I'm from these 3 places. - Some confused kid from Language Center ~ |
|
|
| Report Abuse |
|
|
elucidir
|
  |
| Joined: 08 Aug 2011 |
| Total Posts: 243 |
|
|
| 10 Aug 2011 10:22 PM |
If you only need it for 3 points, you could just use this:
local a = point1 local b = point2 local c = point3
local n = a local m = -3*A+4*B-C local l = 2*A-4*B+2*C
for i = 0, 1, .01 do local i = iteration/total_iterations CFrame = CFrame.new(i^2*l+i*m+n) end |
|
|
| Report Abuse |
|
|
aboy5643a
|
  |
| Joined: 20 Nov 2010 |
| Total Posts: 2785 |
|
|
| 10 Aug 2011 10:53 PM |
The issue is that it would need to curve throughout all points smoothly. And I've allowed that number to be infinite (well, as much as your CPU will handle I suppose..)
~Post here if you're Viet Namese, Canadian or Chinese. I'm from these 3 places. - Some confused kid from Language Center ~ |
|
|
| Report Abuse |
|
|