ParaToxic Posted November 26, 2012 Share Posted November 26, 2012 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 Quote Link to comment Share on other sites More sharing options...
Aily Posted November 27, 2012 Share Posted November 27, 2012 This one works good, you can port it on C++. http://actionsnippet.com/?p=1031 Quote "Better" is big enemy of "good" Link to comment Share on other sites More sharing options...
Roland Posted November 27, 2012 Share Posted November 27, 2012 This one works good, you can port it on C++. http://actionsnippet.com/?p=1031 How can it for (var t:Number = 0; t <1; t+=rez){ Quote Roland Strålberg Website: https://rstralberg.com Link to comment Share on other sites More sharing options...
Aily Posted November 27, 2012 Share Posted November 27, 2012 How can it 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) Quote "Better" is big enemy of "good" Link to comment Share on other sites More sharing options...
Roland Posted November 27, 2012 Share Posted November 27, 2012 Forget what I said. It can Quote Roland Strålberg Website: https://rstralberg.com Link to comment Share on other sites More sharing options...
ParaToxic Posted November 28, 2012 Author Share Posted November 28, 2012 I have it just save the distance oft the Position and Rotation and divide them by the steps you want.Then add this steps to the current Position and Rotation Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.