chunkified Posted June 10, 2010 Share Posted June 10, 2010 (edited) Hello, I'm currently constructing a rollercoaster tool. ~The track is a curve and custom sweep SOP. Problem is that I'd like to animate the cars down the same sweep as there is roll and twists so a standard path animation doesn't work. (see image below) Image link: http://img80.imageshack.us/img80/4753/sweep.jpg Suggestions would be great... Thanks! N Edited June 10, 2010 by chunkified Quote Link to comment Share on other sites More sharing options...
pclaes Posted June 11, 2010 Share Posted June 11, 2010 (edited) How about having sweeping a line (with just two points) along your path. You then should be able to control all the roling and twisting you need. With the add sop you can reconstruct two curves out of the above result, just skip a point each time. So now you have two curves that are close to each other and ocassionally roll a bit around each other, but never touch. The first curve will be the animation path for you object, the second curve will be the animation path for a null. This null will then become the lookat object for your object. (kinda like constantely defining the up vector.) You can probably add a little bit of noise to the path of the null in corners and turns, so the carriages seem to be not to steady. (or detect their speed in chops and mix in noise that way). You could also try instancing entire carriages on a series of points with up vectors and everything set-up. Those points and attributes could be extracted from the above two curves you generated with the sweep-add combination. You can use a carve with an animated value, copy sop and timeshift. - there's a video tutorial on the sidefx website doing pebbles and tank threads with sweeps, might help you. Edited June 11, 2010 by pclaes Quote Link to comment Share on other sites More sharing options...
chunkified Posted June 11, 2010 Author Share Posted June 11, 2010 Hey Peter... Didn't think of doing it that way! Trying it out now and i'll post any progress. Thanks for your reply Quote Link to comment Share on other sites More sharing options...
chunkified Posted June 15, 2010 Author Share Posted June 15, 2010 Hey, I tried the whole Look At constraint method and got the same result as the null was still flipping along the curve. I have however by sweeping a line with normals, managed to get the coaster path curve with the normals pointing in the direction i'd like the cars to go. (see picture). Is there anyway to extract normal direction as a set of rotation values that I could pass to somewhere else? Quote Link to comment Share on other sites More sharing options...
anim Posted June 15, 2010 Share Posted June 15, 2010 you can use primuv() expression to extract attribute from curve according to u value (i don't recommend to use it with "N" directly since it seems not to be using custom point N) here is quick example path_upvector.hip Quote Link to comment Share on other sites More sharing options...
Macha Posted June 16, 2010 Share Posted June 16, 2010 (edited) It is usually not a good idea to align things with Euler angles (messy). But if for some reason you want or need to do it you can use the inverse sine, asin(), expression on each of the normal's components. Expressions use degrees, and VOPs use radians, so you may need to convert. It's simple but there is a problem with flipping when values pass over pi or 180 degrees. You can avoid that if you do a more complicated procedure that uses rotations matrices. I have attached an example of it (play it). The example shows how to get rotation angles from a vector. The important part is inside the red node. The green switch node lets you try different motions. All the other stuff is just to set up the demonstration. angles.hipnc Edited June 16, 2010 by Macha Quote Link to comment Share on other sites More sharing options...
anim Posted June 16, 2010 Share Posted June 16, 2010 what is Euler on up-vector approach? did you experience any problems with that? Quote Link to comment Share on other sites More sharing options...
Macha Posted June 16, 2010 Share Posted June 16, 2010 what is Euler on up-vector approach? did you experience any problems with that? Sorry, I'm not sure what you mean. Your example is better and more elegant but if Chunkified wants to have explicit rotation values from vectors for some reason, then this is one way of doing it. Quote Link to comment Share on other sites More sharing options...
anim Posted June 16, 2010 Share Posted June 16, 2010 ah ok, i was thinking you are refering to my example so i didn't understand what does the upvector orienting have in common with Euler angles i am sure that Chunkified wanted to extract rotations just to correctly orient path constraint, so custom up-vector attribute would be the way to go Quote Link to comment Share on other sites More sharing options...
chunkified Posted June 16, 2010 Author Share Posted June 16, 2010 you can use primuv() expression to extract attribute from curve according to u value (i don't recommend to use it with "N" directly since it seems not to be using custom point N) here is quick example PERFECT!! I was rattling my brain for hours trying to get this sorted! It is usually not a good idea to align things with Euler angles (messy). But if for some reason you want or need to do it you can use the inverse sine, asin(), expression on each of the normal's components. Expressions use degrees, and VOPs use radians, so you may need to convert. It's simple but there is a problem with flipping when values pass over pi or 180 degrees. You can avoid that if you do a more complicated procedure that uses rotations matrices. I have attached an example of it (play it). The example shows how to get rotation angles from a vector. The important part is inside the red node. The green switch node lets you try different motions. All the other stuff is just to set up the demonstration. Your file is definitely getting stored away in my uber folder! lol! What other uses for this are there? Thanks for your help both of you.... Here's some videos of a very early version of the tool: 1 Quote Link to comment Share on other sites More sharing options...
ikarus Posted June 16, 2010 Share Posted June 16, 2010 this is pretty sweet man, can't wait to see it finished Rollercoaster Tycoon in Houdini anyone? Quote Link to comment Share on other sites More sharing options...
chunkified Posted August 11, 2010 Author Share Posted August 11, 2010 A demo of the finished tool is on my site now: http://www.chunkified.com/ and the finished tvc will be up shortly... 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.