• Create Account

Awesome job so far everyone! Please give us your feedback on how our article efforts are going. We still need more finished articles for our May contest theme: Remake the Classics

### #Actuallaylay

Posted 04 November 2012 - 01:22 PM

I'm working on a rollercoaster simulation, I have a path of points so that means I have the tangents for each point.
I'm calculating the binormals and normals as explained here: http://www.cs.cmu.ed...sst2camera.html

The problem with that is the normals start to roll when going up and turning, so when the path comes back down, the normals aren't facing directly up like you'd expect. What I want to do is lock the rolling of the track so for example, if you tried to create a loop, the path would start to twist when getting near to the top so there's never any roll in the track.

So I've found a paper that I think solves this but I'm having trouble understanding what they mean at the "roll snap" section.

https://dip.felk.cvu...er_2010bach.pdf

It first off starts by saying "Using a dot product, we calculate the angle between the vector pointing straight up ((0, 1, 0)?) and a vector being the up vector that we want to straighten."

That itself confuses me because if i dot a normal of (0,1,0) and (0,1,0), that's going to give me a value of 1. That is not an angle i should be applying to the normal because in that situation the normal is correct and doesn't need to be corrected.

Tried to explain as best I could. If not, here's an image that explains what I want to happen.

If I have a track like this that has roll, I want to remove all roll by rotating the normal around the tangent.

The reason why I need to do this is so the user can define the roll of each node instead of the track rolling on its own when creating the track.

### #1laylay

Posted 04 November 2012 - 01:17 PM

I'm working on a rollercoaster simulation, I have a path of points so that means I have the tangents for each point.
I'm calculating the binormals and normals as explained here: http://www.cs.cmu.edu/afs/andrew/scs/cs/15-462/web/old/asst2camera.html

The problem with that is the normals start to roll when going up and turning, so when the path comes back down, the normals aren't facing directly up like you'd expect. What I want to do is lock the rolling of the track so for example, if you tried to create a loop, the path would start to twist when getting near to the top so there's never any roll in the track.

So I've found a paper that I think solves this but I'm having trouble understanding what they mean at the "roll snap" section.

https://dip.felk.cvut.cz/browse/pdfcache/hykovter_2010bach.pdf

It first off starts by saying "Using a dot product, we calculate the angle between the vector pointing straight up ((0, 1, 0)?) and a vector being the up vector that we want to straighten."

That itself confuses me because if i dot a normal of (0,1,0) and (0,1,0), that's going to give me a value of 1. That is not an angle i should be applying to the normal because in that situation the normal is correct and doesn't need to be corrected.

Tried to explain as best I could. If not, here's an image that explains what I want to happen.

If I have a track like this that has roll, I want to remove all roll by rotating the normal around the tangent.

PARTNERS