Jump to content

Spline class


ParaToxic
 Share

Recommended Posts

Hello guys I have a question about spline implementation.

I have some nodes for different menus in my main menu and want to have a fading of the camera position and rotation from one to an other node.

 

I thought about splines ,but how can I do that in C++ ??

And if , is there a way to do that non linear ( I mean exponentially for example)

 

Thanks

Link to comment
Share on other sites

How can it smile.png

 

for (var t:Number = 0; t <1; t+=rez){

 

I don't unerstanding you, think it can be ported to C like

 

 

float rez=0.1f;
for (float t=0.0f; t<1.0f; t+=rez)
{
}

 

hmm, or not?

 

main idea is to build spline class with control points going from start to end, and rez here is spline position from 0....1, 1- it's end. So if first path point is 0,0, and second - last 100,100, then rez=0.5 returns ~50,50. But if there will be more control points such code will return spline position smoothed.

 

And this little function realy helps to get value betwen 4 spline points (if there will be less its easy to fill it like first,first,first,last for example :))

 

Works with 3D too (checked)

"Better" is big enemy of "good"

Link to comment
Share on other sites

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.

 Share

×
×
  • Create New...