Roller Coaster

Blitz3D Forums/Blitz3D Programming/Roller Coaster

Oiduts Studios(Posted 2009) [#1]
Ok, so i am doing a project at school and i was wondering how hard it would be to make a roller coaster in blitz3d? It would have to have near perfect physics but it would not be that complex. Something were i could press a key and the ride starts and ends, thats simple right? But the ride could not be pre-scripted. Probably one loop and 3 drops, no corkscrews or anything in that realm. The project says we have to make a roller coaster from a list of mediums and one happened to be 3d modeling. i guess i would use anim8or to make the ride and car. And then JV-Ode for the physics. Is this a good idea or should i break out the Styrofoam and glue sticks and get to work?

EDIT- opps i just realized i would not be able to make the whole ride in anim8or but just sections of it right?


Matty(Posted 2009) [#2]
Why do you think you couldn't make the whole ride in one piece?


Oiduts Studios(Posted 2009) [#3]
opps again i had to rethink my first thought,ha. Ya well i could do it in one piece. Maybe i could do a marble like thing and make it roll around the track. Could i even do this without JV-ode or would it be easier to use JV-Ode?


VIP3R(Posted 2009) [#4]

It would have to have near perfect physics but it would not be that complex. Something were i could press a key and the ride starts and ends, thats simple right?


Near perfect physics on a roller coaster... simple? I hope you're good at mathematics and the laws of dynamics, because you'll need to be.

Does it need to be simulated? [edit: missed the bit about pre-scripted]


Oiduts Studios(Posted 2009) [#5]
Well im saying what if i had a ball that "rolled" down the track. That is very simple to do if i have JV-Ode right?


Matty(Posted 2009) [#6]
It's actually very simple - if you have what is effectively a 2d roller coaster, basically dips and rises with no banking corners...a bit like a slide with bumps and loops in it.

You have the cart with a certain amount of initial potential energy (due to position ie height - mass x gravity x height) which is converted 100% into kinetic energy (assuming no losses due to friction of any sort - 0.5 * mass * (velocity squared)) as it changes height. Unless additional energy is supplied to the system the maximum height the roller coaster can reach is equal to the initial height.

So what you have is this:

Change in Potential Energy = mass * gravity * change in height
Change in Kinetic Energy = Change in Potential Energy = 0.5 * mass * velocity^2

So align the y-axis of your cart to the normal of your track and move it the appropriate velocity according to the system described above.

Something similar to this should not be too hard.


Oiduts Studios(Posted 2009) [#7]
Wow thats awesome... I will get my friend on it and we will start designing it i guess. Thanks a lot for explaining all of this to me!


_Skully(Posted 2009) [#8]
Also, you can use a path to move the roller coaster car on, thats how you can actually have loops. A path is just a series of points that connect back to the first one. Align the rotation of the car with the path.. the more points in the path, the smoother the movement. If you really want to get fancy (and you really should for a rollercoaster, you can use belzier curves for the path.


Oiduts Studios(Posted 2009) [#9]
Can you please describe a belzier curve.


Matty(Posted 2009) [#10]
http://en.wikipedia.org/wiki/B%C3%A9zier_curve


VIP3R(Posted 2009) [#11]

Well im saying what if i had a ball that "rolled" down the track. That is very simple to do if i have JV-Ode right?


Sure, that would be simple enough in a 2D perspective in ODE, but you wouldn't need a physics engine for this, as Matty has shown above.

I was picturing a 3D roller coaster with linked cars which rolled along a track without flying off of it, with banked turns, loops etc. That's not quite so simple in a physics engine like ODE, I just wanted to make you aware of that since you mentioned JV-ODE specifically ;)


Oiduts Studios(Posted 2009) [#12]
Ok ok, i get it, i should of explained what i needed better.